Comments belonging to two different models

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.

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