-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removeAttribute creates a dirty model #152
Comments
Awesome catch! A fix will come in a few days. |
So essentially after calling |
Thanks for replying to the issue @baopham! I’ve worked around it myself by designing the removeAttributes use to only be used as a one-off action which isn’t too bad, but will be very grateful if you solve it! Yeah, sounds really tricky. I hadn’t thought of using |
referring to this part of the dynamodb documentation you can just add |
This is perfect @Tamrael! Much easier then what I had in mind |
Fixed in v4.11.1 |
Just removed 7 lines of code already from one project 👌 Thank you very much! |
Describe the bug
When using
removeAttribute()
, followed bysave()
, it will save the model as it was before.In Eloquent, the model checks to see if it’s dirty before saving:
Which would solve the case where
removeAttributes()
is run and then asave()
is performed anyway, such as on anupdate
-type of request, but it wouldn’t solve the adding/removing at the same time problem.Version info
The text was updated successfully, but these errors were encountered: