Module: ActAsCached::ActiveRecord::HasManyThroughAssociation

Defined in:
lib/act_as_cached/active_record/has_many_through_association.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



4
5
6
7
8
# File 'lib/act_as_cached/active_record/has_many_through_association.rb', line 4

def self.included(klass)
  klass.class_eval do
    alias_method_chain :find_target,:act_as_cache
  end
end

Instance Method Details

#find_target_with_act_as_cacheObject



10
11
12
13
14
# File 'lib/act_as_cached/active_record/has_many_through_association.rb', line 10

def find_target_with_act_as_cache
  enabled_cache? ?
  fetch_cache(cache_path) { find_target_without_act_as_cache } :
  find_target_without_act_as_cache
end