module Neo4j::ActiveRel::Initialize

Public Instance Methods

init_on_load(persisted_rel, from_node_id, to_node_id, type) click to toggle source

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

   # File lib/neo4j/active_rel/initialize.rb
11 def init_on_load(persisted_rel, from_node_id, to_node_id, type)
12   @rel_type = type
13   @_persisted_obj = persisted_rel
14   changed_attributes_clear!
15   @attributes = convert_and_assign_attributes(persisted_rel.props)
16   load_nodes(from_node_id, to_node_id)
17 end
init_on_reload(unwrapped_reloaded) click to toggle source
   # File lib/neo4j/active_rel/initialize.rb
19 def init_on_reload(unwrapped_reloaded)
20   @attributes = nil
21   init_on_load(unwrapped_reloaded,
22                unwrapped_reloaded.start_node_id,
23                unwrapped_reloaded.end_node_id,
24                unwrapped_reloaded.rel_type)
25   self
26 end