Module: ActiveGraph::Relationship::Initialize
- Extended by:
- ActiveSupport::Concern
- Includes:
- Shared::Initialize
- Included in:
- ActiveGraph::Relationship
- Defined in:
- lib/active_graph/relationship/initialize.rb
Instance Method Summary collapse
-
#init_on_load(persisted_rel, from_node_id, to_node_id, type) ⇒ Object
called when loading the rel from the database.
- #init_on_reload(unwrapped_reloaded) ⇒ Object
Methods included from Shared::Initialize
Instance Method Details
#init_on_load(persisted_rel, from_node_id, to_node_id, type) ⇒ Object
called when loading the rel from the database
11 12 13 14 15 16 17 |
# File 'lib/active_graph/relationship/initialize.rb', line 11 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 |
#init_on_reload(unwrapped_reloaded) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/active_graph/relationship/initialize.rb', line 19 def init_on_reload(unwrapped_reloaded) @attributes = nil init_on_load(unwrapped_reloaded, unwrapped_reloaded.start_node_element_id, unwrapped_reloaded.end_node_element_id, unwrapped_reloaded.type) self end |