Forum: Ruby on Rails Polymorphic Associations

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.
E7349346374a0c685bf8055b7977af5c?d=identicon&s=25 Andrei Erdoss (cautaro)
on 2007-07-24 21:55

I hope somebody can help me figure out how to solve the following

These are the models that I am trying to associate one to the other.

Organization => league, club, etc.
Event => competition, class, etc.

League and Club (and others) are subclasses of Organization
Competition and Class (and others) are subclasses of Event
An event and an organization have many locations and a location has many
organizations and events.

I have tried using STI at first and then polymorphic associations. I
didn't get too far, because this example uses two layers of polymorphic
associations. Can someone give me a starting point at least?


599cd6de77619cbf533946e10167bd16?d=identicon&s=25 JAWspeak (Guest)
on 2007-07-26 00:46
(Received via mailing list)
I'm not sure what you're asking exactly, but can you try to create a
very basic polymorphic association? Then slowly add to it making it
more complex?

This helps me often

On Jul 24, 3:55 pm, Andrei Erdoss <>
This topic is locked and can not be replied to.