Module: Mongoid::Relations::CounterCache
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Relations
- Defined in:
- lib/mongoid/relations/counter_cache.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#reset_counters(*counters) ⇒ Object
Reset the given counter using the .count() query from the db.
Instance Method Details
#reset_counters(*counters) ⇒ Object
Reset the given counter using the .count() query from the db. This method is usuful in case that a counter got corrupted, or a new counter was added to the collection.
17 18 19 |
# File 'lib/mongoid/relations/counter_cache.rb', line 17 def reset_counters(*counters) self.class.reset_counters(self, *counters) end |