Permalink
Browse files

Avoid loading the ActiveRecord::SessionStore class on initialization …

…if it is not in use [#2737 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
1 parent ead5d88 commit 60122e81a3504ed171a761573ed16cb034c79c13 @lukemelia lukemelia committed with lifo May 30, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/initializer.rb
View
2 railties/lib/initializer.rb
@@ -442,7 +442,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

0 comments on commit 60122e8

Please sign in to comment.