instance method
cache
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.2.3Signature
cache(&block)
Enable the query cache within the block if Active Record is configured.
Parameters
-
blockblock
Source
# File activerecord/lib/active_record/query_cache.rb, line 4
def cache(&block)
if ActiveRecord::Base.configurations.blank?
yield
else
connection.cache(&block)
end
end
Defined in activerecord/lib/active_record/query_cache.rb line 4
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::QueryCache