Module: ActiveRecord::Turntable::ActiveRecordExt::QueryCache::ClassMethods::V5_0_1

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

Instance Method Summary collapse

Instance Method Details

#complete(state) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 50

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

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

#runObject



39
40
41
42
43
44
45
46
47
48
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 39

def run
  result = super

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

  [*result, pools]
end