Approach #3: Use many_to_many
Learn how to implement polymorphism in Ecto using many_to_many associations.
A single notes
table
The final approach to create polymorphic associations is to use many_to_many.
With this approach, we create a single notes
table, then add separate join tables for each of the different associations we want to use with notes.
We would set this up the same way we did ...
Press + to interact
create table(:notes_with_joins) doadd :note, :text, null: falseadd :author, :string, null: falsetimestamps()end
We also added ...