diff options
author | Marcin Raczkowski <marcin.raczkowski@gmail.com> | 2010-10-03 15:10:35 +0200 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-11-19 19:08:11 -0300 |
commit | 740450514ce86d56926d8749b1e230012b368567 (patch) | |
tree | 47936f4bbb00c67b45ce72dee4feba8e3f648f8b /activerecord/lib | |
parent | 24485b9ef0b9d02d3dcacf16d9e4127f235228cb (diff) | |
download | rails-740450514ce86d56926d8749b1e230012b368567.tar.gz rails-740450514ce86d56926d8749b1e230012b368567.tar.bz2 rails-740450514ce86d56926d8749b1e230012b368567.zip |
Test reorganization
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/identity_map.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/identity_map.rb b/activerecord/lib/active_record/identity_map.rb index c9edd441a4..b0ff88d8bf 100644 --- a/activerecord/lib/active_record/identity_map.rb +++ b/activerecord/lib/active_record/identity_map.rb @@ -56,9 +56,11 @@ module ActiveRecord # +coder+ must contain the attributes necessary for initializing an empty # model object. def reinit_with(coder) - @previously_changed = changes - @attributes_cache, @changed_attributes = {}, {} - @attributes.update(coder['attributes']) + @attributes_cache = {} + dirty = @changed_attributes.keys + @attributes.update(coder['attributes'].except(*dirty)) + @changed_attributes.update(coder['attributes'].slice(*dirty)) + @changed_attributes.delete_if{|k,v| v.eql? @attributes[k]} _run_find_callbacks |