diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-15 11:22:24 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:07:43 -0300 |
commit | f3adddb966f3c93de4992b42cf554e3ef2a3acf1 (patch) | |
tree | 83d31288faa055e1dfc9a7474a9c7d52c9374e66 /activerecord/lib | |
parent | e83f5a0ae97889dddfd0956081b0f4582594cda9 (diff) | |
download | rails-f3adddb966f3c93de4992b42cf554e3ef2a3acf1.tar.gz rails-f3adddb966f3c93de4992b42cf554e3ef2a3acf1.tar.bz2 rails-f3adddb966f3c93de4992b42cf554e3ef2a3acf1.zip |
Remove objects from identity map if save! failed, otherwise finding again the same record will have invalid attributes.
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index 91d16ca97a..40ab37b5d2 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -33,6 +33,9 @@ module ActiveRecord @previously_changed = changes @changed_attributes.clear end + rescue + IdentityMap.remove(self) if IdentityMap.enabled? + raise end # <tt>reload</tt> the record and clears changed attributes. |