Module: Mongoid::BelongsToWithCounterCache::ClassMethods
- Defined in:
- lib/mongoid_misc/belongs_to_with_counter_cache.rb
Instance Method Summary collapse
-
#belongs_to(name, options = {}, &block) ⇒ Object
CounterCache belongs_to :item, counter_cashe: true.
Instance Method Details
#belongs_to(name, options = {}, &block) ⇒ Object
CounterCache belongs_to :item, counter_cashe: true
9 10 11 12 |
# File 'lib/mongoid_misc/belongs_to_with_counter_cache.rb', line 9 def belongs_to name, = {}, &block add_counter_cache name, if .delete(:counter_cache) super end |