Module: ActiveRecordHostPool::ClearQueryCachePatch

Defined in:
lib/active_record_host_pool/clear_query_cache_patch.rb

Overview

For Rails 6.0.

Instance Method Summary collapse

Instance Method Details

#clear_query_caches_for_current_threadObject



31
32
33
34
35
36
37
# File 'lib/active_record_host_pool/clear_query_cache_patch.rb', line 31

def clear_query_caches_for_current_thread
  ActiveRecord::Base.connection_handlers.each_value do |handler|
    handler.connection_pool_list.each do |pool|
      pool._unproxied_connection.clear_query_cache if pool.active_connection?
    end
  end
end