Forum: Ruby on Rails namespace pollution??

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Michael E. (Guest)
on 2005-12-13 17:20
(Received via mailing list)
Hi all -

I'm having a problem where I have a model named City and I my
application also calls a web service that encaspulates an object named
City (I'm using wsdl2ruby to generate the classes).   I can wrap this
web service City class in a module like this:

module WebServiceModule
  class City
  end
end


but when I run my code in Rails, I get a superclass mismatch error
when I include the module.  I'm not sure what's going on actually
because similar code in plain old Ruby doesn't exhibit this behavior.
 Does Rails somehow put everything into some sort of flattened
namespace?

Any help would be appreciated as we model a lot of common types such
as StateProvince, Country, etc that many of our suppliers also model
using the same names and I need to namespace them using Modules (at
least that's how I think they should be namespaced - open to other
ideas though!).

Thanks

Mike
This topic is locked and can not be replied to.