Module: Resque::Plugins::QueryCache
- Defined in:
- lib/resque/plugins/query_cache.rb,
lib/resque/plugins/query_cache/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Method Summary collapse
Instance Method Details
#around_perform_query_cache(*args) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/resque/plugins/query_cache.rb', line 6 def around_perform_query_cache(*args) query_cache_enabled = ActiveRecord::Base.connection.query_cache_enabled connection_id = ActiveRecord::Base.connection_id ActiveRecord::Base.connection.enable_query_cache! yield if block_given? ensure ActiveRecord::Base.connection_id = connection_id ActiveRecord::Base.connection.clear_query_cache ActiveRecord::Base.connection.disable_query_cache! unless query_cache_enabled end |