On Wed, Apr 16, 2014 at 2:43 AM, Stephen Paul Weber <
singpol...@singpolyma.net> wrote:

The case I've run into the gem *is* namespaced, but with a name that
> clashed with one of my model names.  Rails as currently implemented does
> not control the namespace, but given how the autoloader works I don't see
> any reason it couldn't.  A middleground would be to have the autoloader
> expect classes to be so namespaced, and make sure the activerecord stuff,
> etc, expected it as well -- that has the advantage of being less magical,
> and the disadvantage of being less magical.
>

It is even more unusual to have a clash with a top-level namespace of a gem
:).

I don't think automatic namespacing is the way to go, but out of curiosity
if user.rb has

    class User < AR::Base
    end

and UsersController references User and triggers loading that file, how
would you put User under a namespace? What about the name of the class?
What about the nesting by which the constants in User are resolved?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to