lib/mongoid/persistence.rb
# Update the document attributes in the database and raise an error if
# validation failed.
#
# @example Update the document's attributes.
#   document.update_attributes(:title => "Sir")
#
# @param [ Hash ] attributes The attributes to update.
#
# @raise [ Errors::Validations ] If validation failed.
#
# @return [ true, false ] True if validation passed.
Update the document attributes in the database and raise an error if
validation failed.
Update the document attributes in the database and raise an error if validation failed .
def update_attributes!(attributes = {}, options = {})
      result = update_attributes(attributes, options)
      unless result
        self.class.fail_validate!(self) if errors.any?
        self.class.fail_callback!(self, :update_attributes!)
      end
      result
    end
def update_attributes! ( attributes = { } , options = { } ) result = update_attributes ( attributes , options ) unless result self . class . fail_validate! ( self ) if errors . any? self . class . fail_callback! ( self , :update_attributes! ) end result end
Update the document attributes in the database and raise an error if
validation failed.
Update the document attributes in the database and raise an error if validation failed .
True if validation passed.
True if validation passed .
 true, false 
[ Errors::Validations ] If validation failed.
[ Errors :: Validations ] If validation failed .
attributes
<not_specific>
options
<not_specific>
<not_specific>
attributes The attributes to update.
attributes The attributes to update .
example
Update the document's attributes. document.update_attributes(:title => "Sir")
Update the document ' s attributes . document . update_attributes ( : title = > " Sir " )