Method: CouchbaseOrm::Persistence#save!

Defined in:
lib/couchbase-orm/persistence.rb

#save!(**options) ⇒ Object

Saves the model.

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

By default, #save! always runs validations. If any of them fail CouchbaseOrm::Error::RecordInvalid gets raised, and the record won’t be saved.



98
99
100
101
# File 'lib/couchbase-orm/persistence.rb', line 98

def save!(**options)
    self.class.fail_validate!(self) unless self.save(**options)
    self
end