Module: ActiveRecord::Turntable::ActiveRecordExt::QueryCache::ClassMethods::V5_1

Defined in:
lib/active_record/turntable/active_record_ext/query_cache.rb

Instance Method Summary collapse

Instance Method Details

#complete(state) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 28

def complete(state)
  caching_pool, caching_was_enabled, turntable_pools = state
  super([caching_pool, caching_was_enabled])

  turntable_pools.each do |pool|
    pool.disable_query_cache! unless caching_was_enabled
  end
end

#runObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 17

def run
  result = super

  pools = ActiveRecord::Base.turntable_pool_list
  pools.each do |pool|
    pool.enable_query_cache!
  end

  [*result, pools]
end