solidusio / solidus_support

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

Don't skip the first namespace for controller paths #80

Closed elia closed 1 year ago

elia commented 1 year ago

Summary

Autoload paths are meant to list autoload roots and not the first level of the namespace.

E.g. having the following controller in lib/controllers/solidus_foo:

lib/controllers/solidus_foo/spree/my_controller.rb

The autoload will be triggered by a constant reference to Spree::MyController targeting spree/my_controller.rb inside lib/controllers/solidus_foo/. This means the autoload path needs to be lib/controllers/solidus_foo/.

See also https://edgeguides.rubyonrails.org/classic_to_zeitwerk_howto.html#globs-in-config-autoload-paths

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

elia commented 1 year ago

@DanielePalombo @mamhoff can you confirm if fixes the issue for your projects?

kennyadsl commented 1 year ago

Released in 0.9.3