rails/rails — pull request #6073 by daveyeu (2012-04-30 02:48:57+00:00)
Title: Restore state on create when ActiveRecord::RecordInvalid is raised

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.