提交 73cc5f27 编写于 作者: J Joshua Peek

Setup ActiveRecord QueryCache middleware in the initializer

上级 82334a74
......@@ -4,8 +4,6 @@
use "ActionController::Failsafe"
use "ActiveRecord::QueryCache", :if => lambda { defined?(ActiveRecord) }
["ActionController::Session::CookieStore",
"ActionController::Session::MemCacheStore",
"ActiveRecord::SessionStore"].each do |store|
......@@ -18,6 +16,6 @@
)
end
use ActionController::RewindableInput
use ActionController::ParamsParser
use Rack::MethodOverride
use "ActionController::RewindableInput"
use "ActionController::ParamsParser"
use "Rack::MethodOverride"
......@@ -408,6 +408,7 @@ def initialize_database
if configuration.frameworks.include?(:active_record)
ActiveRecord::Base.configurations = configuration.database_configuration
ActiveRecord::Base.establish_connection
configuration.middleware.use ActiveRecord::QueryCache
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册