aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorVipul A M <vipulnsward@gmail.com>2013-07-29 01:12:34 +0530
committerVipul A M <vipulnsward@gmail.com>2013-12-03 17:48:14 +0530
commit1ed81e85ca1d2518400b56c167f3c196c51afede (patch)
treef35ba3e98f3fe87ea55a8630f5c45f27a72ccd3e /activerecord/lib/active_record
parentb6f189e2f0bcc8f36f52c83e8ac2255d5e578a42 (diff)
downloadrails-1ed81e85ca1d2518400b56c167f3c196c51afede.tar.gz
rails-1ed81e85ca1d2518400b56c167f3c196c51afede.tar.bz2
rails-1ed81e85ca1d2518400b56c167f3c196c51afede.zip
Currently, we clear query_cache in cache block finish, even if we may already have cache true.
This commit takes into account the last cache_enabled value, before clearing query_cache.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
index 8399232d73..adc23a6674 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
@@ -31,8 +31,8 @@ module ActiveRecord
old, @query_cache_enabled = @query_cache_enabled, true
yield
ensure
- clear_query_cache
@query_cache_enabled = old
+ clear_query_cache unless @query_cache_enabled
end
def enable_query_cache!