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
Restore state on create when ActiveRecord::RecordInvalid is raised #6073
Restore state on create when ActiveRecord::RecordInvalid is raised #6073
Conversation
cc @tenderlove |
👍 |
No comment or activity for 3 months. Change looks good to me, are there any complications that would prevent it from being merged in? |
@daveyeu could you add a CHANGELOG entry. I'll merge this one. |
There ya go @rafaelfranca, thanks! |
uh oh, this needs a rebase! Darn CHANGELOGs. |
Do you mean I should squash the commits? Or rebase against rails HEAD? Or both? Sorry, not too familiar with the protocol, and I hate to force push anything that's public, but I'm happy to if that's the way it goes. |
We need a rebase against master. But rebase + squash would be better. |
Ok, rebased and squashed. Rakes green against master too. |
Restore state on create when ActiveRecord::RecordInvalid is raised
Done. Thank you |
Restore state on create when ActiveRecord::RecordInvalid is raised Conflicts: activerecord/CHANGELOG.md
This fixes issue #3217.
Previously, a call to AR#create that raised AR::RecordInvalid would leave a record in an inconsistent state -- it wouldn't actually be saved in the database, but #persisted? => true and #id would be non-nil. This patch also merges clean into 3-2-stable, for now.