Skip to content

many-to-many polymorphic

March 16, 2011

I had to recently create a many to many polymorphic association.

Note that this is unique.

You can have a polymorphic association, in which, for example a comment can be applied to more than one different models. But a comment can belong to one model. two models do not have the same comment.

You can have a many to many relationship, in which an employee can have many departments and a department can have many employees.

But, this is a combination of both.

If the same comment could be applied to different models multiple times then it would be a many-to-many polymorphic association.

This blog entry helped me.


From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: