instance method
update!
Ruby on Rails 4.0.13
Since v4.0.13Signature
update!(attributes)
Updates its receiver just like update but calls save! instead of save, so an exception is raised if the record is invalid.
Parameters
-
attributesreq
Source
# File activerecord/lib/active_record/persistence.rb, line 239
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
Defined in activerecord/lib/active_record/persistence.rb line 239
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence