Module: ActAsCached::ActiveRecord::CollectionAssociation

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



5
6
7
8
9
# File 'lib/act_as_cached/active_record/collection_association.rb', line 5

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



11
12
13
14
15
# File 'lib/act_as_cached/active_record/collection_association.rb', line 11

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