Forum: Ruby on Rails Mistaking with polymorphic associations?!

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.
045393257ca8795742d87e6b2945f151?d=identicon&s=25 Luiz Vitor Martinez Cardoso (Guest)
on 2008-10-07 00:31
(Received via mailing list)
Hello,

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
Comment
model. But the expected behavior needs to be: When a new comment is
created
i need to refer it in Recipe and Comments. To clarify i need to be able
to
search for one Recipe and use something like Recipe.comments to find
comments!

Any suggestions?

Regards,
Grabber.
This topic is locked and can not be replied to.