Method: CouchbaseOrm::Persistence#update_attribute
- Defined in:
- lib/couchbase-orm/persistence.rb
#update_attribute(name, value) ⇒ Object
Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records. Also note that
-
Validation is skipped.
-
Callbacks are invoked.
151 152 153 154 |
# File 'lib/couchbase-orm/persistence.rb', line 151 def update_attribute(name, value) public_send(:"#{name}=", value) changed? ? save(validate: false) : true end |