method
decrement!
v6.1.7.7 -
Show latest stable
- Class:
ActiveRecord::Persistence
decrement!(attribute, by = 1, touch: nil)public
Wrapper around #decrement 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.