-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecation warning when using Zeitwerk and loading custom session class in initializer #164
Comments
I think we can leverage the # config/initializers/session_store.rb
Rails.application.config.session_store :active_record_store, key: "_my_app_session"
Rails.application.config.to_prepare do
ActionDispatch::Session::ActiveRecordStore.session_class = MySessionClass
end The code in the |
@stevenharman your suggestion worked for me. |
I have a use case which requires a custom ActiveRecord session class implementation, and I provide that configuration as specified here:
I think an ideal location to put this line is a Rails initializer. However, since Zeitwerk comes enabled with Rails 6 by default, new apps have started throwing a deprecation warning:
It seems just writing this line in an initializer is going to raise an error in a future version of Rails. Please advise on the best method to resolve this.
The text was updated successfully, but these errors were encountered: