Skip to content

Commit

Permalink
Fix Multi.run usage in contexts guide (#3440)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach authored and Gazler committed Jun 10, 2019
1 parent b2e0420 commit 4102c0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/contexts.md
Expand Up @@ -1096,8 +1096,8 @@ defmodule Hello.UserRegistration do

def register_user(params) do
Multi.new()
|> Multi.run(:user, fn _ -> Accounts.create_user(params) end)
|> Multi.run(:author, fn %{user: user} ->
|> Multi.run(:user, fn _repo, _ -> Accounts.create_user(params) end)
|> Multi.run(:author, fn _repo, %{user: user} ->
{:ok, CMS.ensure_author_exists(user)}
end)
|> Repo.transaction()
Expand Down

0 comments on commit 4102c0d

Please sign in to comment.