-
Notifications
You must be signed in to change notification settings - Fork 22
Overrides getAttributesForInsert & getDirtyForUpdate instead of performInsert & performUpdate to #88
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
Conversation
Wow, thank you very very much for the quick response on this! Can we maybe add a simple test case to prevent regressions in the future? Something like a quick model event test? Thank you so much! |
I just saw, we do not have a proper eloquent test ready, so see this as optional if it is too much for now, we will do it later anyway. |
I'll write a test to avoid future regression, it's not a problem. Probably during the weekend or on Monday. |
Just re-thinking about it. Adding database tests means that github actions will now need to run postgres + postgis to valid the tests. I am not familiar with github actions so I can't provide a PR on that. What do you recommend? |
Dont worry i can add those later thank you 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking so long! Was really swamped in the last weeks.
Just checked the code and this looks very good!
It is a much cleaner solution and both methods fit perfectly for our use case!
Note: I might add tests later on, but that depends on how we will implement this in v2, where we might switch to casters anyway.
Thank you so much for looking into this! We really really appreciate the effort!
Oh @RomainMazB, can you quickly run If not i can also do that :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@saibotk can you release this fix ? |
done @maximepvrt sry should have done that sooner! |
This fix #87 by decreasing the code override from the Eloquent Model class.
performInsert
method, we now override thegetAttributesForInsert
method which only cares about getting the attributes to be inserted into the database.performUpdate
method, we now override thegetDirtyForUpdate
method which only cares about getting the modified attributes to be updated into the database.