Skip to content

Commit 3800be6

Browse files
committed
Allow passing through opts in Ecto.Adapters.SQL.Sandbox.allow/4 calls
1 parent 22c7112 commit 3800be6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ecto/adapters/sql/sandbox.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,11 @@ defmodule Ecto.Adapters.SQL.Sandbox do
597597
"""
598598
@spec allow(Ecto.Repo.t() | pid(), pid(), term()) ::
599599
:ok | {:already, :owner | :allowed} | :not_found
600-
def allow(repo, parent, allow, _opts \\ []) when is_atom(repo) or is_pid(repo) do
600+
def allow(repo, parent, allow, opts \\ []) when is_atom(repo) or is_pid(repo) do
601601
case GenServer.whereis(allow) do
602602
pid when is_pid(pid) ->
603-
%{pid: pool, opts: opts} = lookup_meta!(repo)
603+
%{pid: pool, opts: meta_opts} = lookup_meta!(repo)
604+
opts = Keyword.merge(meta_opts, opts)
604605
DBConnection.Ownership.ownership_allow(pool, parent, pid, opts)
605606

606607
other ->

0 commit comments

Comments
 (0)