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!(**) self.class.fail_validate!(self) unless self.save(**) self end |