Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit 845b3b0

Browse files
halfdancoburncoburn
authored andcommitted
Fix proxy to Ecto.transaction/2 (#37)
closes #35
1 parent e43af6e commit 845b3b0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/new_relixir/plug/repo.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ defmodule NewRelixir.Plug.Repo do
2626

2727
import NewRelixir.Plug.Instrumentation
2828

29-
@spec transaction(Keyword.t, fun) :: {:ok, any} | {:error, any}
30-
def transaction(opts \\ [], fun) when is_list(opts) do
31-
repo().transaction(opts, fun)
29+
@spec transaction(fun, Keyword.t) :: {:ok, any} | {:error, any}
30+
def transaction(fun, opts \\ []) when is_list(opts) do
31+
repo().transaction(fun, opts)
3232
end
3333

3434
@spec rollback(any) :: no_return

test/new_relixir/plug/repo_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ defmodule NewRelixir.Plug.RepoTest do
1515
def stop(_pid, _timeout \\ 5000) do
1616
end
1717

18-
def transaction(opts \\ [], fun) when is_list(opts) do
19-
record_call(:transaction, [opts, fun])
18+
def transaction(fun, opts \\ []) when is_list(opts) do
19+
record_call(:transaction, [fun, opts])
2020
end
2121

2222
def rollback(value) do

0 commit comments

Comments
 (0)