What you really need is polymorphic associations.
But you can also just get a plugin with the code already implemented -
http://github.com/jackdempsey/acts_as_commentable/tree/master
-
MaurĂcio Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr
On Fri, Jun 26, 2009 at 3:09 PM,
Toushi<inferno.designer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Hello,
> I am building a project management application, and I want my clients
> to be able to comment on multiple things.
> For instance I have 2 models: milestones, and tickets, I have the
> foreign keys for both of them in the comments model and linked them
> with has_many and belongs_to. I am just wondering if this is possible?
> Or if there is a better way to do it.
>
> Thanks,
> Ben.
>
> >
>