Skip to content
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

Add updated? and created? methods on SaveOperations #904

Conversation

davidepaolotua
Copy link
Contributor

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)

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)
@jwoertink
Copy link
Member

This is great! Thanks for doing this. I think the only part missing for it to complete #888 is that it needs to work on upsert as well. That was actually the one bit I really needed for this. But if you don't have time to add that, I'm willing to accept this as a partial implementation. I think it's already super useful.

@davidepaolotua
Copy link
Contributor Author

I'm probably drunk or missing the point but... Doesn't it work for upsert as well? Have a look at the changed tests, but I'm pretty sure I added a check in there (iirc, it was a free-to-have in defining these two methods)

@jwoertink
Copy link
Member

Nope, I'm the drunk one! I totally missed that your specs cover upsert already 🎉 Thanks for pointing that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants