solidusio / solidus_support

Common runtime helpers for Solidus extensions.
BSD 3-Clause "New" or "Revised" License
9 stars 23 forks source link

Fixes isse when zeitwerk is not enabled #38

Closed softr8 closed 4 years ago

softr8 commented 4 years ago

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)
aldesantis commented 4 years ago

@softr8 thanks, good catch!

aldesantis commented 4 years ago

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

wayferer commented 4 years ago

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