Polymorphism with Many-to-Many Associations – A Teach Me To Code Tutorial

Polymorphic associations are very simple, as are many-to-many associations. When you blend the two, it’s not nearly as simple. Since there isn’t a working build-in mechanism for many-to-many polymorphic associations.

Here’s a quick demo of what happens if you try to set up a traditional has_many :through association with a polymorphic association. I also show how to set things up so you can get the associated objects.

Download 101.3 MB
Download (iPod & iPhone) 45.5 MB