Method: Neo4j::Shared::Persistence#update

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

#update(attributes) ⇒ Object Also known as: update_attributes

Updates this resource with all the attributes from the passed-in Hash and requests that the record be saved. If saving fails because the resource is invalid then false will be returned.



182
183
184
185
186
187
188
189
# File 'lib/neo4j/shared/persistence.rb', line 182

def update(attributes)
  self.class.run_transaction do |tx|
    self.attributes = process_attributes(attributes)
    saved = save
    tx.mark_failed unless saved
    saved
  end
end