-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add lib/controllers/ENGINE to the autoload_paths #78
Add lib/controllers/ENGINE to the autoload_paths #78
Conversation
@elia, this is the ticket we have investigated today. |
@DanielePalombo I'm not sure to understand the problem: are you decorating a controller that has been defined in the same engine? I'm sure I'm missing something, can you make a rough example? |
@kennyadsl as a result of the investigation we discovered that with Rails 5.2 and Solidus 3 the The decorator paths were added to the autoload paths here but the same wasn't done for lib/controllers. |
Ah, so, so we are talking about decorating controllers defined in other extensions, which are not autoloaded, makes sense now! |
Thank you @elia for the explaination |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a suggestion to improve readability, up to you!
SolidusSupport added `lib/decorators/#{engine}` to the autoload_paths, but there are no other autoloaded_paths for `lib`. This is a problem when the decorator tries to decorates an existing class, because it's not loaded yet.
433eadd
to
7a03048
Compare
Merged, do we need a new version released? |
Yes, please! |
@DanielePalombo @elia done! |
Summary
SolidusSupport added
lib/decorators/#{engine}
to the autoload_paths, but there are no other autoloaded_paths forlib
. This is a problem when the decorator tries to decorate an existingclass
, because it's not loaded yet.A real example, happened on solidus_social, because it decorates a controller defined on solidus_auth_devise.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: