Forum: Ruby on Rails Class/Subclass and has_many belongs_to

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.
Alberto (Guest)
on 2007-03-05 21:31

I would appreciate some hint. I can't modify Class A1 but I can subclass
it so I wonder how can I get access to its belongs_to and has_many i.e.

Class A1 < ActiveRecord::Base
belongs_to : B1
belongs_to : C1
has_many :D1


Class myClass < ActiveRecord::A1

The above doesn't work.. Well it doesn't do the insert ..

MyClass and A1 table are exactly the same. Any suggestions?

Damian T. (Guest)
on 2007-03-08 17:55
(Received via mailing list)
Try to write the second class as

Class myClass < A1

Class A1 It is not in module ActiveRecord, is it?
This topic is locked and can not be replied to.