Forum: Ruby namespace conflicts

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.
2c80e1b0837eec76d38d4f7fa1c15e87?d=identicon&s=25 Michael Gorsuch (Guest)
on 2006-05-14 15:13
(Received via mailing list)
Good morning, everyone.

I'm curious as to how I can resolve some namespace conflicts.  I'm
writing a
Rails app (although this problem should be agnostic), and wrote a
Payment
model (which is a class for those that don't use Rails) for my app.

I also have need to use the Payment gem from ruby forge, which uses
'Payment' as the name for the module.

I obviously have a conflict here, but I'm wondering if anyone has any
interesting ideas as to how I can solve it.

As far as I see it, I'll need to rename one of the two objects.

Thanks to everyone,

Michael
E34b5cae57e0dd170114dba444e37852?d=identicon&s=25 Logan Capaldo (Guest)
on 2006-05-14 18:22
(Received via mailing list)
On May 14, 2006, at 9:12 AM, Michael Gorsuch wrote:

>
> I obviously have a conflict here, but I'm wondering if anyone has any
> interesting ideas as to how I can solve it.
>
> As far as I see it, I'll need to rename one of the two objects.
>
> Thanks to everyone,
>
> Michael

Nest your app in it's own namespace?

module Gorsuch
   class Payment < ActiveRecord::Base
      ...
   end
end

Gorsuch::Payment.new #etc.
2c80e1b0837eec76d38d4f7fa1c15e87?d=identicon&s=25 Michael Gorsuch (Guest)
on 2006-05-14 19:59
(Received via mailing list)
Whoah.  Thanks for that.
This topic is locked and can not be replied to.