Class: ActiveRecordMultipleQueryCache::Rails5QueryCache

Inherits:
Base
  • Object
show all
Defined in:
lib/active_record_multiple_query_cache/rails5_query_cache.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from ActiveRecordMultipleQueryCache::Base

Instance Method Details

#complete(caching_pool, caching_was_enabled) ⇒ Object



12
13
14
# File 'lib/active_record_multiple_query_cache/rails5_query_cache.rb', line 12

def complete((caching_pool, caching_was_enabled))
  caching_pool.disable_query_cache! unless caching_was_enabled
end

#runObject



3
4
5
6
7
8
9
10
# File 'lib/active_record_multiple_query_cache/rails5_query_cache.rb', line 3

def run
  caching_pool = active_record_base_class.connection.pool
  caching_was_enabled = caching_pool.query_cache_enabled

  caching_pool.enable_query_cache!

  [caching_pool, caching_was_enabled]
end