automatic_namespaces
automatic_namespaces copied to clipboard
Application-specific inflections are loaded *after* automatic_namespace is initialized
The automatic_namespace assumed for a pack is pack_name.camelize. If the pack name contains words whose inflections are customized by an inflection config initializer in the app, the gem concludes a DIFFERENT namespace than Zeitwerk will conclude.
For example, if config/initializer/inflections.rb contains this:
inflect.acronym 'API'
and the pack is packs/api with automatic_namespace enabled, the gem will assign namespace Api to the classes, whereas Zeitwerk will expect the namespace API.
The work-around is to use the namespace_override: in the metadata list.