instance method
cache
Ruby on Rails 2.2.3
Since v2.2.3Signature
cache()
Enable the query cache within the block.
Source
# File activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb, line 31
def cache
old, @query_cache_enabled = @query_cache_enabled, true
@query_cache ||= {}
yield
ensure
clear_query_cache
@query_cache_enabled = old
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb line 31
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::QueryCache