instance method
increment!
Ruby on Rails 4.1.16
Since v3.0.20Signature
increment!(attribute, by = 1)
Wrapper around increment that saves the record. This method differs from its non-bang version in that it passes through the attribute setter. Saving is not subjected to validation checks. Returns true if the record could be saved.
Parameters
-
attributereq -
byopt = 1
Source
# File activerecord/lib/active_record/persistence.rb, line 301
def increment!(attribute, by = 1)
increment(attribute, by).update_attribute(attribute, self[attribute])
end
Defined in activerecord/lib/active_record/persistence.rb line 301
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Persistence