提交 54984f0f 编写于 作者: L Luke Melia 提交者: Joshua Peek

Avoid loading the ActiveRecord::SessionStore class on initialization if it is...

Avoid loading the ActiveRecord::SessionStore class on initialization if it is not in use [#2737 state:resolved]
Signed-off-by: NJoshua Peek <josh@joshpeek.com>
上级 e7d6f48e
......@@ -450,7 +450,7 @@ def initialize_database
def initialize_database_middleware
if configuration.frameworks.include?(:active_record)
if configuration.frameworks.include?(:action_controller) &&
ActionController::Base.session_store == ActiveRecord::SessionStore
ActionController::Base.session_store.name == 'ActiveRecord::SessionStore'
configuration.middleware.insert_before :"ActiveRecord::SessionStore", ActiveRecord::ConnectionAdapters::ConnectionManagement
configuration.middleware.insert_before :"ActiveRecord::SessionStore", ActiveRecord::QueryCache
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册