Method: ActiveRecord::ConnectionAdapters::QueryCache#cache

Defined in:
lib/active_record/connection_adapters/abstract/query_cache.rb

#cacheObject

Enable the query cache within the block.



59
60
61
62
63
64
65
# File 'lib/active_record/connection_adapters/abstract/query_cache.rb', line 59

def cache
  old, @query_cache_enabled = @query_cache_enabled, true
  yield
ensure
  @query_cache_enabled = old
  clear_query_cache unless @query_cache_enabled
end