Forum: Ruby on Rails ActiveResource: a tag that has the same name as an existing

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Pat M. (Guest)
on 2007-02-07 04:00
(Received via mailing list)
I've got an ActiveRecord::Base class named Tracker.  I've also got an
ActiveResource class named MyConfig that will read an xml file that
looks like:


class MyConfig < ActiveResource::Base = "http://localhost"

If I do MyConfig.find(1), I get:

NoMethodError: undefined method `name=' for #<Tracker:0x2487378>

ARes apparently creates new classes for all these sub-elements, and it
does them in the MyConfig context (so it should make
MyConfig::Tracker).  If I type MyConfig::Tracker into the console, I
>> MyConfig::Tracker
(irb):13: warning: toplevel constant Tracker referenced by
=> Tracker

Why is it doing this?  And how do I fix it?  I need to keep my Tracker
ActiveRecord class, and the xml file has to have the <tracker>

This topic is locked and can not be replied to.