Sha256: b380bde775f532a2b10216f1e167e3211a43c8cb9a0fd546c340286ce66127ab

Contents?: true

Size: 659 Bytes

Versions: 8

Compression:

Stored size: 659 Bytes

Contents

module ActiveGraph::Node::Initialize
  extend ActiveSupport::Concern
  include ActiveGraph::Shared::Initialize

  attr_reader :called_by

  # called when loading the node from the database
  # @param [ActiveGraph::Node] persisted_node the node this class wraps
  # @param [Hash] properties of the persisted node.
  def init_on_load(persisted_node, properties)
    self.class.extract_association_attributes!(properties)
    @_persisted_obj = persisted_node
    changed_attributes_clear!
    @attributes = convert_and_assign_attributes(properties)
  end

  def init_on_reload(reloaded)
    @attributes = nil
    init_on_load(reloaded, reloaded.props)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
activegraph-10.0.0.pre.beta.8 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.7 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.6 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.5 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.4 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.3 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.2 lib/active_graph/node/initialize.rb
activegraph-10.0.0.pre.beta.1 lib/active_graph/node/initialize.rb