From 951e18abea9c116fc5d6b330ca1dcd2890abe006 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 2 May 2011 11:30:49 -0700 Subject: introduce a body proxy to ensure that query cache is enabled during streaming --- .../lib/active_record/connection_adapters/abstract/query_cache.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activerecord/lib/active_record/connection_adapters') 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 1db397f584..093c30aa42 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb @@ -29,6 +29,14 @@ module ActiveRecord @query_cache_enabled = old end + def enable_query_cache! + @query_cache_enabled = true + end + + def disable_query_cache! + @query_cache_enabled = false + end + # Disable the query cache within the block. def uncached old, @query_cache_enabled = @query_cache_enabled, false -- cgit v1.2.3