I’m having a bit of trouble with has_many foreign key relationships in Ecto, I’ve followed the instructions but with no luck. I’ve added the foreign_key_constraint to the changeset, so I’m expecting an {:error, _} tuple, but i’m getting an uncaught Ecto.ConstraintError
Explanation
Ecto’s constraints_to_errors function uses the changeset to detect the constraints, however because I piped my struct directly into the Repo.delete function instead of passing it to a changeset first, the constraint I set was never picked up
As a minor note, copying and pasting text works a lot better than screen shots. It allows others who want to help to copy some part of your text and edit it easily to improve it without having to retype all of it by hand. It also works better on different resolution / size screens.