1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #11435 from kennyj/move_to_query_cache

Move initializing process for @query_cache to QueryCache module.
This commit is contained in:
Yves Senn 2013-07-16 04:54:48 -07:00
commit 525d7c30d0
2 changed files with 6 additions and 2 deletions

View file

@ -20,6 +20,12 @@ module ActiveRecord
attr_reader :query_cache, :query_cache_enabled
def initialize(*)
super
@query_cache = Hash.new { |h,sql| h[sql] = {} }
@query_cache_enabled = false
end
# Enable the query cache within the block.
def cache
old, @query_cache_enabled = @query_cache_enabled, true

View file

@ -95,8 +95,6 @@ module ActiveRecord
@last_use = false
@logger = logger
@pool = pool
@query_cache = Hash.new { |h,sql| h[sql] = {} }
@query_cache_enabled = false
@schema_cache = SchemaCache.new self
@visitor = nil
end