instance method reinit_with

Ruby on Rails 3.2.22.5

Since v3.1.12 Last seen in v3.2.22.5

Available in: v3.1.12 v3.2.22.5

Signature

reinit_with(coder)

Reinitialize an Identity Map model object from coder. coder must contain the attributes necessary for initializing an empty model object.

Parameters

coder req
Source
# File activerecord/lib/active_record/identity_map.rb, line 118
    def reinit_with(coder)
      @attributes_cache = {}
      dirty      = @changed_attributes.keys
      attributes = self.class.initialize_attributes(coder['attributes'].except(*dirty))
      @attributes.update(attributes)
      @changed_attributes.update(coder['attributes'].slice(*dirty))
      @changed_attributes.delete_if{|k,v| v.eql? @attributes[k]}

      run_callbacks :find

      self
    end

Defined in activerecord/lib/active_record/identity_map.rb line 118 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::IdentityMap

Type at least 2 characters to search.

↑↓ navigate · open · esc close