Persistence

Constants

  • USES_CLASSNAME

Methods

#_active_record_destroyed_behavior?

+ show/hide code

#_create_node

+ show/hide code
#_destroyed_double_check?

These two methods should be removed in 6.0.0

+ show/hide code

#apply_default_values

+ show/hide code

#cache_key

+ show/hide code
#create_model

Creates a model with values matching those of the instance attributes and returns its id.

+ show/hide code

#create_or_update

+ show/hide code

#destroy

+ show/hide code
#destroyed?

Returns +true+ if the object was destroyed.

+ show/hide code

#exist?

+ show/hide code

#freeze

+ show/hide code

#frozen?

+ show/hide code
#new?

Returns +true+ if the record hasn’t been saved to Neo4j yet.

+ show/hide code
#new_record?

Returns +true+ if the record hasn’t been saved to Neo4j yet.

+ show/hide code
#persisted?

Returns +true+ if the record is persisted, i.e. it’s not a new record and it was not destroyed

+ show/hide code

#props

+ show/hide code

#reload

+ show/hide code

#reload_from_database

+ show/hide code
#save

Saves the model.

If the model is new a record gets created in the database, otherwise the existing record gets updated. If perform_validation is true validations run. If any of them fail the action is cancelled and save returns false. If the flag is false validations are bypassed altogether. See ActiveRecord::Validations for more information. There’s a series of callbacks associated with save. If any of the before_* callbacks return false the action is cancelled and save returns false.

+ show/hide code
#save!

Persist the object to the database. Validations and Callbacks are included by default but validation can be disabled by passing :validate => false to #save! Creates a new transaction.

+ show/hide code
#update

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.

+ show/hide code
#update!

Same as {#update_attributes}, but raises an exception if saving fails.

+ show/hide code
#update_attribute

Convenience method to set attribute and #save at the same time

+ show/hide code
#update_attribute!

Convenience method to set attribute and #save! at the same time

+ show/hide code
#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.

+ show/hide code
#update_attributes!

Same as {#update_attributes}, but raises an exception if saving fails.

+ show/hide code

#update_model

+ show/hide code