diff --git a/lib/active_record/session_store.rb b/lib/active_record/session_store.rb index fde698d..9027564 100644 --- a/lib/active_record/session_store.rb +++ b/lib/active_record/session_store.rb @@ -7,6 +7,8 @@ module ActiveRecord module SessionStore + autoload :Session, 'active_record/session_store/session' + module ClassMethods # :nodoc: mattr_accessor :serializer @@ -111,7 +113,6 @@ def self.dump(value) ActiveSupport.on_load(:active_record) do require 'active_record/session_store/session' - ActionDispatch::Session::ActiveRecordStore.session_class = ActiveRecord::SessionStore::Session end require 'active_record/session_store/sql_bypass' diff --git a/lib/active_record/session_store/session.rb b/lib/active_record/session_store/session.rb index 3fafe5e..461c6f8 100644 --- a/lib/active_record/session_store/session.rb +++ b/lib/active_record/session_store/session.rb @@ -103,3 +103,5 @@ def raise_on_session_data_overflow! end end end + +ActionDispatch::Session::ActiveRecordStore.session_class = ActiveRecord::SessionStore::Session