module

RethinkORM::Persistence

Instance methods

delete

Only deletes document from table. No callbacks or updated associations

Source
destroy

Destroy object, run destroy callbacks and update associations

Source
destroyed=(destroyed : Bool)
Source
destroyed?
Source
new_record?

Id generated on save or set on load

Source
persisted?
Source
reload!

Reload the model in place.

Raises

  • RethinkORM::Error::DocumentNotSaved if document was not previously persisted
  • RethinkORM::Error::DocumentNotFound if document fails to load
Source
save

Saves the model.

If the model is new, a record gets created in the database, otherwise the existing record gets updated.

Source
save!

Saves the model.

If the model is new, a record gets created in the database, otherwise the existing record gets updated.

Raises

  • RethinkORM::Error:DocumentNotSaved if was document was destroyed before save
  • RethinkORM::Error:DocumentNotSaved if was document was not saved by RethinkDB
  • RethinkORM::Error:DocumentInvalid on validation failures
Source
update

Updates the model

Non-atomic updates are required for multidocument updates

Source
update!

Updates the model in place

Raises RethinkORM::Error::DocumentInvalid on update failure

Source
update_fields

Atomically update specified fields, without running callbacks

Source