Sha256: fb92b3d23a9cfcbe59af9bc90452b201f0aeb399c126718784359a4c0a87d5e6

Contents?: true

Size: 1.1 KB

Versions: 54

Compression:

Stored size: 1.1 KB

Contents

module Neo4j::ActiveRel
  module Initialize
    extend ActiveSupport::Concern
    include Neo4j::Shared::Initialize

    # called when loading the rel from the database
    # @param [Neo4j::Embedded::EmbeddedRelationship, Neo4j::Server::CypherRelationship] persisted_rel properties of this relationship
    # @param [Neo4j::Relationship] from_node_id The neo_id of the starting node of this rel
    # @param [Neo4j::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)
      @rel_type = type
      @_persisted_obj = persisted_rel
      changed_attributes && changed_attributes.clear
      @attributes = convert_and_assign_attributes(persisted_rel.props)
      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.rel_type)
      self
    end
  end
end

Version data entries

54 entries across 54 versions & 2 rubygems

Version Path
neo4j-7.2.3 lib/neo4j/active_rel/initialize.rb
neo4j-7.2.2 lib/neo4j/active_rel/initialize.rb
neo4j-7.1.4 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.16 lib/neo4j/active_rel/initialize.rb
neo4j-7.2.1 lib/neo4j/active_rel/initialize.rb
neo4j_legacy-7.2.0.2 lib/neo4j/active_rel/initialize.rb
neo4j_legacy-7.2.0.1 lib/neo4j/active_rel/initialize.rb
neo4j-7.2.0 lib/neo4j/active_rel/initialize.rb
neo4j-7.1.3 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.15 lib/neo4j/active_rel/initialize.rb
neo4j-7.1.2 lib/neo4j/active_rel/initialize.rb
neo4j-7.1.1 lib/neo4j/active_rel/initialize.rb
neo4j-7.1.0 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.14 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.13 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.12 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.11 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.10 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.9 lib/neo4j/active_rel/initialize.rb
neo4j-7.0.8 lib/neo4j/active_rel/initialize.rb