-
Notifications
You must be signed in to change notification settings - Fork 64
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
Upsert operations should tell you if a record was created or updated #888
Labels
Comments
jwoertink
added
feature request
A new requested feature / option
easy/high impact
hacktoberfest
Valid Issue for Hacktoberfest
labels
Oct 7, 2022
davidepaolotua
added a commit
to davidepaolotua/avram
that referenced
this issue
Oct 25, 2022
Implements luckyframework#888. Adds two new boolean methods to SaveOperation. They work similarly to new_record? but always return false if the record was not persisted (e.g: failed save or not-yet-performed operation)
One thing I forgot to consider on this.... What are the results when the save fails? I guess if you're calling |
jwoertink
pushed a commit
that referenced
this issue
Oct 27, 2022
Implements #888. Adds two new boolean methods to SaveOperation. They work similarly to new_record? but always return false if the record was not persisted (e.g: failed save or not-yet-performed operation)
jwoertink
pushed a commit
that referenced
this issue
Dec 2, 2022
* Add updated? and created? methods on SaveOperations Implements #888. Adds two new boolean methods to SaveOperation. They work similarly to new_record? but always return false if the record was not persisted (e.g: failed save or not-yet-performed operation) * Implement date function * Move upper and lower to new criterias * generalize the application of functions to columns * Put in standby the extra-param function creation * Final clean up
This is now done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you're using an upsert, you may want to know whether the record that comes back was an updated record or a new record.
This could really hook in to all SaveOperation too.
We already have
operation.saved?
avram/src/avram/save_operation.cr
Lines 27 to 28 in 9c8caec
The text was updated successfully, but these errors were encountered: