You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just ran into this for the first time and thought it was worth talking about: because models and controllers and such just live in the root namespace, they can be shadowed when importing a gem.
My proposal (for discussion) is that Rails could put all the app classes inside the module that exists for the app (as defined in config/application.rb). Autoloading, auto-lookup, etc would use the fully-qualified name, but the unqualified name would still work everywhere in app code because we're inside the module. Then if an overlapping name exists in a gem we can get at it with ::Name, etc.
Thoughts?
The text was updated successfully, but these errors were encountered:
Just ran into this for the first time and thought it was worth talking about: because models and controllers and such just live in the root namespace, they can be shadowed when importing a gem.
My proposal (for discussion) is that Rails could put all the app classes inside the module that exists for the app (as defined in
config/application.rb
). Autoloading, auto-lookup, etc would use the fully-qualified name, but the unqualified name would still work everywhere in app code because we're inside the module. Then if an overlapping name exists in a gem we can get at it with::Name
, etc.Thoughts?
The text was updated successfully, but these errors were encountered: