Module: Neo4j::ActiveRel::Persistence::ClassMethods
- Defined in:
- lib/neo4j/active_rel/persistence.rb
Instance Method Summary collapse
-
#create(*args) ⇒ Object
Creates a new relationship between objects.
-
#create!(*args) ⇒ Object
Same as #create, but raises an error if there is a problem during save.
- #create_method ⇒ Object
- #load_entity(id) ⇒ Object
Instance Method Details
#create(*args) ⇒ Object
Creates a new relationship between objects
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_method ⇒ Object
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 |