instance method
update!
Ruby on Rails edge
Since v7.0.10Signature
update!(id = :all, attributes)
Updates the object (or multiple objects) just like #update but calls #update! instead of update, so an exception is raised if the record is invalid and saving will fail.
Parameters
-
idopt = :all -
attributesreq
Source
# File activerecord/lib/active_record/persistence.rb, line 138
def update!(id = :all, attributes)
all.update!(id, attributes)
end
Defined in activerecord/lib/active_record/persistence.rb line 138
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence::ClassMethods