# Namespace problem

**URL:** <https://www.ruby-forum.com/t/namespace-problem/112721>\
**Category:** Rails\
**Created:** [August 22, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/namespace-problem/112721 "2007-08-22T16:22:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![laurin1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/919ad9/32.png) [@laurin1](https://www.ruby-forum.com/u/laurin1)\
**Post date:** [August 22, 2007, 4:22pm UTC](https://www.ruby-forum.com/t/namespace-problem/112721/1 "2007-08-22T16:22:29Z")

</div>

Hi,

I have a problem with namespacing. I had a model called Country and I  
have added the acts as Globalize plugin which also has a plugin called  
Country.

Now of course I have conflicts through my code. Is there a way to  
address models correctly to resolve this?

Thanks,

Keith

---

<div class="post-metadata">

**Author:** ![laurin1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/919ad9/32.png) [@laurin1](https://www.ruby-forum.com/u/laurin1)\
**Post date:** [August 22, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/namespace-problem/112721/2 "2007-08-22T19:28:09Z")

</div>

Keith D. wrote:

> Hi,
> 
> I have a problem with namespacing. I had a model called Country and I  
> have added the acts as Globalize plugin which also has a plugin called  
> Country.
> 
> Now of course I have conflicts through my code. Is there a way to  
> address models correctly to resolve this?
> 
> Thanks,
> 
> Keith

To me this sounds like a design error in the “acts as Globalize plugin”  
plugins should not be polluting the global namespace like that. My  
first guess therefore is to ‘require’ the plugin, but not ‘include’ its  
name space. I am not familiar with this plugin, but most keep themselves  
in a module to prevent just this problem.

If that is not the case, you really have two options:

- cajole, shoehorn, or monkeypatch your plugin into a separate  
namespace
- Bite the bullet an change your ‘Country’ to something else.

If you find the plugin useful, you might also consider adding namespace  
protections to it and submitting a patch to the maintainer so other who  
use the code will not have the same issue. (or you could be a cheep  
sleeze and just send an e-mail to the maintainer asking them to do it  
for you.)
