ActiveRecord::CounterCache::ClassMethods

module ActiveRecord::CounterCache::ClassMethods

Public Instance Methods

decrement_counter(counter_name, id) Show source

Decrement a numeric field by one, via a direct SQL update.

This works the same as #increment_counter but reduces the column value by 1 instead of increasing it.

Parameters