Rails 4 Composite Model using Polymorphism
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: This is my attempt to brain-storm/puzzle this out. It may not (and likely does not) work out of the box. Feel free to add, patch, and comment. For now, it is untested so use this at your own peril.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
In Rails, a polymorphic association allows a model with a foreign key to switch (select) between various other models that can be its owner through a has_one or has_many relationship. At the database level, this is underpinned by storing a foreign key — an id, the same as any other foreign key — except here, the table for that foreign key is dynamic and is specified in an additional column, type.
So with this in mind, the goal here is to use rails polymorphism to achieve a