Module: Neo4j::ActiveRel::Persistence::ClassMethods

Defined in:
lib/neo4j/active_rel/persistence.rb

Instance Method Summary collapse

Instance Method Details

#create(*args) ⇒ Object

Creates a new relationship between objects

Parameters:

  • props (Hash)

    the properties the new relationship should have



58
59
60
# File 'lib/neo4j/active_rel/persistence.rb', line 58

def create(*args)
  new(*args).tap(&:save)
end

#create!(*args) ⇒ Object

Same as #create, but raises an error if there is a problem during save.



63
64
65
# File 'lib/neo4j/active_rel/persistence.rb', line 63

def create!(*args)
  new(*args).tap(&:save!)
end

#create_methodObject



67
68
69
# File 'lib/neo4j/active_rel/persistence.rb', line 67

def create_method
  creates_unique? ? :create_unique : :create
end

#load_entity(id) ⇒ Object



71
72
73
# File 'lib/neo4j/active_rel/persistence.rb', line 71

def load_entity(id)
  Neo4j::Relationship.load(id)
end