Module: ActiveRecord::Turntable::ActiveRecordExt::QueryCache
- Defined in:
- lib/active_record/turntable/active_record_ext/query_cache.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
- .install_turntable_executor_hooks(executor = ActiveSupport::Executor) ⇒ Object
- .prepended(klass) ⇒ Object
Class Method Details
.install_turntable_executor_hooks(executor = ActiveSupport::Executor) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 85 def self.install_turntable_executor_hooks(executor = ActiveSupport::Executor) return if Util.ar_version_equals_or_later?("5.0.1") executor.to_complete do klasses = ActiveRecord::Base.turntable_connection_classes klasses.each do |k| unless k.connected? && k.connection.transaction_open? k.clear_active_connections! end end end end |
.prepended(klass) ⇒ Object
4 5 6 7 8 |
# File 'lib/active_record/turntable/active_record_ext/query_cache.rb', line 4 def self.prepended(klass) class << klass prepend ClassMethods.compatible_module end end |