Keith Davey 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.)
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---