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

Restore state on create when ActiveRecord::RecordInvalid is raised #6073

Merged
merged 1 commit into from Aug 12, 2012

Conversation

daveyeu
Copy link
Contributor

@daveyeu daveyeu commented Apr 30, 2012

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.

@rafaelfranca
Copy link
Member

cc @tenderlove

@jeremy
Copy link
Member

jeremy commented Apr 30, 2012

👍

@schneems
Copy link
Member

No comment or activity for 3 months. Change looks good to me, are there any complications that would prevent it from being merged in?

@rafaelfranca
Copy link
Member

@daveyeu could you add a CHANGELOG entry. I'll merge this one.

@ghost ghost assigned rafaelfranca Aug 11, 2012
@daveyeu
Copy link
Contributor Author

daveyeu commented Aug 12, 2012

There ya go @rafaelfranca, thanks!

@steveklabnik
Copy link
Member

uh oh, this needs a rebase! Darn CHANGELOGs.

@daveyeu
Copy link
Contributor Author

daveyeu commented Aug 12, 2012

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.

@rafaelfranca
Copy link
Member

We need a rebase against master. But rebase + squash would be better.

@daveyeu
Copy link
Contributor Author

daveyeu commented Aug 12, 2012

Ok, rebased and squashed. Rakes green against master too.

rafaelfranca added a commit that referenced this pull request Aug 12, 2012
Restore state on create when ActiveRecord::RecordInvalid is raised
@rafaelfranca rafaelfranca merged commit 15184d8 into rails:master Aug 12, 2012
@rafaelfranca
Copy link
Member

Done. Thank you

rafaelfranca added a commit that referenced this pull request Aug 12, 2012
Restore state on create when ActiveRecord::RecordInvalid is raised
Conflicts:
	activerecord/CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants