polymorphicHasManyrelationship is a
one-to-manyrelationship. This relationship is used when an entity can belong to multiple types of entities. The classic example for this type of relationship is
polymophicHasManyis a WireBox mapping to the related entity.
prefixfor the polymorphic type. A common convention where is to add
ableto the end of the entity name, though this is not automatically done. In our example, this prefix is
commentable. This tells quick to look for a
commentable_idcolumn in our
Commententity. It stores our entity's mapping as the
_typeand our entity's primary key value as the
name & "_type"
name & "_id"