diff options
author | Vipul A M <vipulnsward@gmail.com> | 2013-07-29 01:12:34 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2013-12-03 17:48:14 +0530 |
commit | 1ed81e85ca1d2518400b56c167f3c196c51afede (patch) | |
tree | f35ba3e98f3fe87ea55a8630f5c45f27a72ccd3e /activerecord/lib | |
parent | b6f189e2f0bcc8f36f52c83e8ac2255d5e578a42 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb | 2 |
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! |