Module: Mongoid::BelongsToWithCounterCache::ClassMethods

Defined in:
lib/mongoid_misc/belongs_to_with_counter_cache.rb

Instance Method Summary collapse

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, options = {}, &block      
  add_counter_cache name, options if options.delete(:counter_cache)
  super
end