Sha256: c8e60a1a9160d21ac499284bb1b3bd04580525d5cf29dbf2de3576fbaf17daec

Contents?: true

Size: 1.11 KB

Versions: 30

Compression:

Stored size: 1.11 KB

Contents

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

    # called when loading the rel from the database
    # @param [ActiveGraph::Embedded::EmbeddedRelationship, Neo4j::Server::CypherRelationship] persisted_rel properties of this relationship
    # @param [ActiveGraph::Relationship] from_node_id The neo_id of the starting node of this rel
    # @param [ActiveGraph::Relationship] to_node_id The neo_id of the ending node of this rel
    # @param [String] type the relationship type
    def init_on_load(persisted_rel, from_node_id, to_node_id, type)
      @type = type
      @_persisted_obj = persisted_rel
      changed_attributes_clear!
      @attributes = convert_and_assign_attributes(persisted_rel.properties)
      load_nodes(from_node_id, to_node_id)
    end

    def init_on_reload(unwrapped_reloaded)
      @attributes = nil
      init_on_load(unwrapped_reloaded,
                   unwrapped_reloaded.start_node_id,
                   unwrapped_reloaded.end_node_id,
                   unwrapped_reloaded.type)
      self
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
activegraph-11.5.0.beta.3 lib/active_graph/relationship/initialize.rb
activegraph-11.5.0.beta.2 lib/active_graph/relationship/initialize.rb
activegraph-11.5.0.beta.1 lib/active_graph/relationship/initialize.rb
activegraph-11.5.0.alpha.1 lib/active_graph/relationship/initialize.rb
activegraph-11.4.0 lib/active_graph/relationship/initialize.rb
activegraph-11.3.1 lib/active_graph/relationship/initialize.rb
activegraph-11.3.0 lib/active_graph/relationship/initialize.rb
activegraph-11.2.0 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0.beta.1 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0.alpha.4 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0.alpha.3 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0.alpha.2 lib/active_graph/relationship/initialize.rb
activegraph-11.1.0.alpha.1 lib/active_graph/relationship/initialize.rb
activegraph-10.2.0.beta.1 lib/active_graph/relationship/initialize.rb
activegraph-11.0.2-java lib/active_graph/relationship/initialize.rb
activegraph-10.1.1 lib/active_graph/relationship/initialize.rb
activegraph-11.0.1-java lib/active_graph/relationship/initialize.rb
activegraph-11.0.0-java lib/active_graph/relationship/initialize.rb
activegraph-10.1.0 lib/active_graph/relationship/initialize.rb