Skip to content

Commit

Permalink
Merge pull request rails#143 from Edouard-chin/ec-fix-lazy-hook-backw…
Browse files Browse the repository at this point in the history
…ard-compatibility

Fix backward compatibility issue introduced by rails#126
  • Loading branch information
rafaelfranca authored and Javi Manso committed Apr 12, 2021
1 parent 9adb070 commit 9f666a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/active_record/session_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

module ActiveRecord
module SessionStore
autoload :Session, 'active_record/session_store/session'

module ClassMethods # :nodoc:
mattr_accessor :serializer

Expand Down Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions lib/active_record/session_store/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,5 @@ def raise_on_session_data_overflow!
end
end
end

ActionDispatch::Session::ActiveRecordStore.session_class = ActiveRecord::SessionStore::Session

0 comments on commit 9f666a0

Please sign in to comment.