Today I Learned

hashrocket A Hashrocket project

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.

See More #elixir TILs
Looking for help? At Hashrocket, we 💜 Elixir! From our many Elixir client projects, to sponsoring the Chicago Elixir Meetup, to the source code for this application, we are invested in this community. Contact us today to talk about your Elixir project.