Method: Mongoid::Relations::CounterCache::ClassMethods#increment_counter
- Defined in:
- lib/mongoid/relations/counter_cache.rb
#increment_counter(counter_name, id) ⇒ Object
Increment the counter name from the entries that match the id by one. This method is used on associations callbacks when counter_cache is enable
59 60 61 |
# File 'lib/mongoid/relations/counter_cache.rb', line 59 def increment_counter(counter_name, id) update_counters(id, counter_name.to_sym => 1) end |