Skip to content

Commit 5959f0f

Browse files
committed
Unallow existing allowances when attempting to allow a Plug to access a connection
1 parent 93143d5 commit 5959f0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/phoenix_ecto/sql/sandbox.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ defmodule Phoenix.Ecto.SQL.Sandbox do
339339
end
340340

341341
def allow(%{repo: repo, owner: owner}, sandbox),
342-
do: Enum.each(List.wrap(repo), &sandbox.allow(&1, owner, self()))
342+
do: Enum.each(List.wrap(repo), &sandbox.allow(&1, owner, self(), unallow_existing: true))
343343

344344
def allow(%{}, _sandbox), do: :ok
345345
def allow(nil, _sandbox), do: :ok

0 commit comments

Comments
 (0)