lib/mongoid/persistable/updatable.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 read-only.
#
# @return [ true, false ] True if save was successful, false if not.
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)
        as_writable_attribute!(name, value) do |access|
          normalized = name.to_s
          process_attribute(normalized, value)
          save(validate: false)
        end
      end
def update_attribute ( name , value ) as_writable_attribute! ( name , value ) do | access | normalized = name . to_s process_attribute ( normalized , value ) save ( validate : false ) end end
Update a single attribute and persist the entire document.
Update a single attribute and persist the entire document .
True if save was successful, false if not.
True if save was successful false if not .
 true, false 
[ Errors::ReadonlyAttribute ] If the field cannot be changed due to being flagged as read-only.
[ Errors :: ReadonlyAttribute ] If the field cannot be changed due to being flagged as read - only .
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 " )