Module: ActiveTools::ActiveRecord::CustomCounterCache
- Extended by:
- ActiveSupport::Concern
- Included in:
- OnLoadActiveRecord
- Defined in:
- lib/active_tools/active_record/custom_counter_cache.rb,
lib/active_tools/active_record/custom_counter_cache/instance_methods.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
Class Method Details
.digger(owner, object, mapping) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/active_tools/active_record/custom_counter_cache.rb', line 50 def self.digger(owner, object, mapping) object.method_digger(mapping) do |object, key, response, value| if response && !response.is_a?(::ActiveRecord::Base) count = case value when String, Symbol then owner.send(value) when Integer then value end yield object, key, count end end end |