Distinguished Ladies and Gents,
I was experiencing some odd behaviour with my app so I decided to make
a simple test to iron it out; I found that it is utterly impossible
for there to be a model in the top namespace by the same name as
another model in another different namespace.
Now, I know modules and namespaces aren't something the Rails Core
puts way up there on the list of priorities, or even if it is on the
list, or any other list, at all, but it would be nice to know if
namespaced models at all is something the Core _wants_ to work in
Rails, or not.
So, if you please.. models in namespaces/models; I know you guys don't
use them much but some of us do, are they Teh Unwanted?
Very best regards,
Tomas Jogin, devoted Rails developer and fan
My test to prove this problem, if anyone is interested:
1. create a new rails app.
2. generate a model called "Whatever"
3. generate a model called "Other::Whatever"
4. run script/console, type: Whatever and find that you get:
"NameError: uninitialized constant Whatever"
5. type Other::Whatever and find that it works.
6. Delete Other::Whatever, run script/console again, and find that now
the Whatever model magically exists again; it would seem loading
Other::Whatever unloads Whatever, or prevents it from loading, or
7. Please note that Other::Whatever and YetAnother::Whatever plays
nice together, but not with Whatever.