-
Notifications
You must be signed in to change notification settings - Fork 190
Open
Description
I have a use case which requires a custom ActiveRecord session class implementation, and I provide that configuration as specified here:
ActionDispatch::Session::ActiveRecordStore.session_class = MySessionClass
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:
DEPRECATION WARNING: Initialization autoloaded the constant MySessionClass.
Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
Reloading does not reboot the application, and therefore code executed during
initialization does not run again. So, if you reload MySessionClass, for example,
the expected changes won't be reflected in that stale Class object.
These autoloaded constants have been unloaded.
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.
Metadata
Metadata
Assignees
Labels
No labels