Skip to content

Commit

Permalink
Move UserClassHandle to lib/
Browse files Browse the repository at this point in the history
This class is potentially loaded during initialization when used by
factories and that can generate problems with reloaders.

In Rails 6 / zeitwerk that resulted in this warning message:

```
DEPRECATION WARNING: Initialization autoloaded the constant Spree::UserClassHandle.

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::UserClassHandle, 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 /my-app/config/environment.rb:5)
```
  • Loading branch information
elia committed Nov 6, 2020
1 parent 304da6d commit d605e9d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/lib/spree/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class GatewayError < RuntimeError; end
require 'spree/core/stock_configuration'
require 'spree/core/validators/email'
require 'spree/permission_sets'
require 'spree/user_class_handle'

require 'spree/preferences/store'
require 'spree/preferences/static_model_preferences'
Expand Down
File renamed without changes.

0 comments on commit d605e9d

Please sign in to comment.