Should I use polymorphic association, just a has_one, or attribute in this case?

Posted by Angela on Stack Overflow See other posts from Stack Overflow or by Angela
Published on 2010-05-14T23:08:47Z Indexed on 2010/05/14 23:14 UTC
Read the original article Hit count: 107

Filed under:

I have three Models: Contact_Email, Contact_Letter, and Contact_Call. These represent the unique pairing of a Contact with a template for each of the three.

For all of these, I want to record at least a status and date for the status. For example, "declined" on 5/10/10 or "responded" on 5/10/10 or something like that. I may in the future want to extend that.

I later do want to be able to see all the instances that have the same status, such as "responded" or "meeting requested."

What is the best way to do this? To make the three Contacts statusable and create a polymorphic association on a model called Status.

Or just each Object of Contact_Email has_one Status?

© Stack Overflow or respective owner

Related posts about polymorphism