Run an abritrary function in Ecto.Multi
If you are building an Ecto.Multi transaction and you need to add a function that is not a direct repo operation, you can use Ecto.Multi.Run
and pass a function to it. The function you pass to Ecto.Multi.Run
must return either {:ok, value}
or {:error, value}
in order for the multi operations to continue.