This is a silly (hopefully temporary) fix for the ongoing incompatibility between ExMachina and PolymorphicEmbed libraries. Stolen from this pull request: mathieuprog/polymorphic_embed#26
def deps do
[
{:ex_machina_polymorphic_embed, "~> 0.1.1", only: :test}
]
end
In your factory replace use ExMachina.Ecto, YourApp.Repo
with ExMachinaPolymorphicEmbed.Ecto, repo: YourApp.Repo