...

/

Wrapping Up: Create Polymorphic Associations

Wrapping Up: Create Polymorphic Associations

Review what we have learned about creating polymorphic associations.

We'll cover the following...

While Ecto doesn’t provide direct support for polymorphic associations as some other frameworks do, it’s still possible to create these associations thanks to the flexibility of Ecto’s tools.

In most cases, we recommend using approach #1 (multiple foreign keys) as it’s the most straightforward approach. However, if the number of foreign keys grows to become problematic, we ...