Closed AlexanderMint closed 4 years ago
This took me a while to figure out that the problem is in the gem and not my setup. Certainly should be fixed ☹️
Relations
, Mappers
and Commands
are reserved namespaces and they cannot be top-level. This is a limitation rather than a bug. Anyway, I plan to improve auto-registration in 6.0.0 so stay tuned.
@solnic the problem is that the example in the docs doesn't work. So maybe that part should be removed from the docs at least?
@tycooon ah yeah that's not good :( It shouldn't be removed though, it should be changed. I'll take a look.
OK I updated this section in the current + old doc versions and now it should reflect the reality better: https://rom-rb.org/learn/core/5.2/framework-setup/#auto-registration
Describe the bug
Auto registration error "uninitialized constant Lib (NameError)"
Traceback:
To Reproduce
app.rb
lib/relations/users.rb
Source: https://rom-rb.org/5.0/learn/advanced/explicit-setup/#namespaces-inferred-from-directory-structure
ruby app.rb
Expected behavior
Auto class registration
Relations::Users
Your environment