method
increment!
v7.0.0 -
Show latest stable
- Class:
ActiveRecord::Persistence
increment!(attribute, by = 1, touch: nil)public
Wrapper around #increment that writes the update to the database. Only attribute is updated; the record itself is not saved. This means that any other modified attributes will still be dirty. Validations and callbacks are skipped. Supports the touch option from update_counters, see that for more. Returns self.