lib/mongoid/persistable/updatable.rb
# Update the document attributes in the database and raise an error if
# validation failed.
#
# @example Update the document's attributes.
#   document.update!(:title => "Sir")
#
# @param [ Hash ] attributes The attributes to update.
#
# @raise [ Errors::Validations ] If validation failed.
# @raise [ Errors::Callbacks ] If a callback returns false.
#
# @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 = {})
        result = update_attributes(attributes)
        unless result
          fail_due_to_validation! unless errors.empty?
          fail_due_to_callback!(:update_attributes!)
        end
        result
      end
def update! ( attributes = { } ) result = update_attributes ( attributes ) unless result fail_due_to_validation! unless errors . empty? fail_due_to_callback! ( :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 .
[ Errors::Callbacks ] If a callback returns false.
[ Errors :: Callbacks ] If a callback returns false .
attributes
<not_specific>
<not_specific>
attributes The attributes to update.
attributes The attributes to update .
example
Update the document's attributes. document.update!(:title => "Sir")
Update the document ' s attributes . document . update! ( : title = > " Sir " )