reinit_with(coder)
public
Reinitialize an Identity Map model object from coder.
coder must contain the attributes necessary for initializing an
empty model object.
# File activerecord/lib/active_record/identity_map.rb, line 112
def reinit_with(coder)
@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]}
set_serialized_attributes
run_callbacks :find
self
end