Skip to content

Commit 17f2b33

Browse files
authored
Merge pull request #48 from mbuhot/ecto_multi_arity_2
Update Ecto.Multi.run example
2 parents 44f35e3 + bd6bfe6 commit 17f2b33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ defmodule MyApp.JobQueue do
125125

126126
def perform(multi = %Ecto.Multi{}, job = %{"type" => "SendEmail", "recipient" => recipient, "body" => body}) do
127127
multi
128-
|> Ecto.Multi.run(:send, fn _ -> EmailService.send(recipient, body) end)
128+
|> Ecto.Multi.run(:send, fn _repo, _changes -> EmailService.send(recipient, body) end)
129129
|> Ecto.Multi.insert(:stats, %EmailSendStats{recipient: recipient})
130130
|> MyApp.Repo.transaction()
131131
end

0 commit comments

Comments
 (0)