diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-09-15 11:18:34 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:07:43 -0300 |
commit | e83f5a0ae97889dddfd0956081b0f4582594cda9 (patch) | |
tree | 261b3bb6f7bcafa2cd108a7105bd032b987b7108 /activerecord/lib/active_record/attribute_methods | |
parent | a9edd6cf932b299e28677cb1e0af397c533caffe (diff) | |
download | rails-e83f5a0ae97889dddfd0956081b0f4582594cda9.tar.gz rails-e83f5a0ae97889dddfd0956081b0f4582594cda9.tar.bz2 rails-e83f5a0ae97889dddfd0956081b0f4582594cda9.zip |
Remove objects from identity map if save failed, otherwise finding again the same record will have invalid attributes.
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/dirty.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb index 439880c1fa..91d16ca97a 100644 --- a/activerecord/lib/active_record/attribute_methods/dirty.rb +++ b/activerecord/lib/active_record/attribute_methods/dirty.rb @@ -21,6 +21,8 @@ module ActiveRecord if status = super @previously_changed = changes @changed_attributes.clear + elsif IdentityMap.enabled? + IdentityMap.remove(self) end status end |