Skip to content
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

Fixes isse when zeitwerk is not enabled #38

Merged
merged 1 commit into from
Jan 16, 2020

Conversation

softr8
Copy link
Contributor

@softr8 softr8 commented Jan 2, 2020

If autoloaders is defined in the Rails object, but the autoloader zeitwerk is not used, it is defined but returns nil when calling main.

It is not enough to check here if autoloaders are enabled, it actually returns true, because it is registered, but if zeitwerk is disabled, Rails.autoloaders.main returns nil causing a no method error

solidus_support-0.4.0/lib/solidus_support/engine_extensions/decorators.rb:22:in `block in activate': undefined method `push_dir' for nil:NilClass (NoMethodError)

If autoloaders is defined in the Rails object, but the
autoloader zeitwerk is not used, it is defined but returns
nil when calling `main`, this ensures the extra check.
@aldesantis
Copy link
Member

@softr8 thanks, good catch!

@aldesantis
Copy link
Member

@kennyadsl could you take a look when you have the chance, since you worked on the original change?

@wayferer
Copy link

wayferer commented Jan 16, 2020

Updated recently and am also running into this issue. Thanks @softr8 for reporting it.

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks @softr8!

@aldesantis aldesantis merged commit 963abf3 into solidusio:master Jan 16, 2020
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