Skip to content

Commit 5ea6ca5

Browse files
committed
Move AuthConfiguration out of autoloading paths
The class is loaded during initialization and, beyond having no point in being autoloaded, it generates an explicit warning in Rails 6, and potential problems in prior versions. Here's the Rails 6 warning: ``` DEPRECATION WARNING: Initialization autoloaded the constant Spree::AuthConfiguration. 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 Spree::AuthConfiguration, for example, the expected changes won't be reflected in that stale Class object. This autoloaded constant has been unloaded. Please, check the "Autoloading and Reloading Constants" guide for solutions. (called from <top (required)> at /Users/elia/Code/Nebulab/olx-ecommerce/config/environment.rb:5) ```
1 parent 102fb7c commit 5ea6ca5

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

lib/spree/auth/engine.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ class Engine < Rails::Engine
1212
engine_name 'solidus_auth'
1313

1414
initializer "spree.auth.environment", before: :load_config_initializers do |_app|
15+
require 'spree/auth_configuration'
16+
1517
Spree::Auth::Config = Spree::AuthConfiguration.new
1618
end
1719

0 commit comments

Comments
 (0)