lib/mongoid/persistence.rb
# Update a single attribute and persist the entire document.
# This skips validation but fires the callbacks.
#
# @example Update the attribute.
#   person.update_attribute(:title, "Sir")
#
# @param [ Symbol, String ] name The name of the attribute.
# @param [ Object ] value The new value of the attribute.a
#
# @raise [ Errors::ReadonlyAttribute ] If the field cannot be changed due
#   to being flagged as reaodnly.
#
# @return [ true, false ] True if save was successfull, false if not.
#
# @since 2.0.0.rc.6
Update a single attribute and persist the entire document.
This skips validation but fires the callbacks.
Update a single attribute and persist the entire document . This skips validation but fires the callbacks .
def update_attribute(name, value)
      unless attribute_writable?(name.to_s)
        raise Errors::ReadonlyAttribute.new(name, value)
      end
      write_attribute(name, value)
      save(validate: false)
    end
def update_attribute ( name , value ) unless attribute_writable? ( name . to_s ) raise Errors :: ReadonlyAttribute . new ( name , value ) end write_attribute ( name , value ) save ( validate : false ) end
Update a single attribute and persist the entire document.
Update a single attribute and persist the entire document .
True if save was successfull, false if not.
True if save was successfull false if not .
 true, false 
[ Errors::ReadonlyAttribute ] If the field cannot be changed due to being flagged as reaodnly.
[ Errors :: ReadonlyAttribute ] If the field cannot be changed due to being flagged as reaodnly .
name
<not_specific>
value
<not_specific>
<not_specific>
value The new value of the attribute.a
value The new value of the attribute . a
example
Update the attribute. person.update_attribute(:title, "Sir")
Update the attribute . person . update_attribute ( : title " Sir " )
since
None