From 1ed81e85ca1d2518400b56c167f3c196c51afede Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Mon, 29 Jul 2013 01:12:34 +0530 Subject: 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. --- .../lib/active_record/connection_adapters/abstract/query_cache.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') 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! -- cgit v1.2.3