Initialize a model and set a bunch of attributes at the same time. Returns the object whether saved successfully or not.
# File lib/neo4j/rails/persistence.rb, line 111 def create(*args) new(*args).tap do |o| yield o if block_given? o.save end end
Same as #create, but raises an error if there is a problem during save. Returns the object whether saved successfully or not.
# File lib/neo4j/rails/persistence.rb, line 120 def create!(*args) new(*args).tap do |o| yield o if block_given? o.save! end end
Destroy each node in turn. Runs the destroy callbacks for each node.
# File lib/neo4j/rails/persistence.rb, line 128 def destroy_all all.each do |n| n.destroy end end