Forum: Ruby on Rails Mistaking with 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.
Luiz Vitor Martinez C. (Guest)
on 2008-10-07 02:31
(Received via mailing list)

I'm trying to solve a problem without success. Look at:

I have 3 models (Recipe, Comments and User)

an Recipe has many Comments
an User has many Comments
an User has many Recipes

I tried to implement this using polymorphic associations with the
model. But the expected behavior needs to be: When a new comment is
i need to refer it in Recipe and Comments. To clarify i need to be able
search for one Recipe and use something like Recipe.comments to find

Any suggestions?

This topic is locked and can not be replied to.