Updates its receiver just like update but calls
save!
instead of save, so an exception is raised if the record is
invalid.
# File activerecord/lib/active_record/persistence.rb, line 260
def update!(attributes)
# The following transaction covers any possible database side-effects of the
# attributes assignment. For example, setting the IDs of a child collection.
with_transaction_returning_status do
assign_attributes(attributes)
save!
end
end