Skip to content

Move UserClassHandle to lib/#3813

Merged
kennyadsl merged 1 commit intosolidusio:masterfrom
nebulab:elia/dont-autoload-user-class-handle
Dec 14, 2020
Merged

Move UserClassHandle to lib/#3813
kennyadsl merged 1 commit intosolidusio:masterfrom
nebulab:elia/dont-autoload-user-class-handle

Conversation

@elia
Copy link
Copy Markdown
Member

@elia elia commented Oct 29, 2020

Description

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)

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

@elia elia force-pushed the elia/dont-autoload-user-class-handle branch from 78dd620 to da04d68 Compare October 29, 2020 09:39
@elia elia force-pushed the elia/dont-autoload-user-class-handle branch from da04d68 to 0dc4498 Compare November 6, 2020 12:29
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)
```
@elia elia force-pushed the elia/dont-autoload-user-class-handle branch from 0dc4498 to d605e9d Compare November 6, 2020 12:31
@elia elia marked this pull request as ready for review November 6, 2020 13:00
Copy link
Copy Markdown
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elia thanks 👍

@kennyadsl kennyadsl merged commit 987ecdd into solidusio:master Dec 14, 2020
@kennyadsl kennyadsl deleted the elia/dont-autoload-user-class-handle branch December 14, 2020 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants