diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-02 11:30:49 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-05-02 11:30:49 -0700 |
commit | 951e18abea9c116fc5d6b330ca1dcd2890abe006 (patch) | |
tree | 5a9a57e72dd1d68af5b1e0883d74ff10057cf63b /activerecord/lib/active_record/connection_adapters | |
parent | 4300855e7dccb06017e6d8de203c60497e5a5321 (diff) | |
download | rails-951e18abea9c116fc5d6b330ca1dcd2890abe006.tar.gz rails-951e18abea9c116fc5d6b330ca1dcd2890abe006.tar.bz2 rails-951e18abea9c116fc5d6b330ca1dcd2890abe006.zip |
introduce a body proxy to ensure that query cache is enabled during streaming
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb | 8 |
1 files changed, 8 insertions, 0 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 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 |