Skip to content

Commit 54623ef

Browse files
committed
Merge functions
1 parent cd86927 commit 54623ef

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

lib/phoenix_ecto/sql/sandbox.ex

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,12 @@ defmodule Phoenix.Ecto.SQL.Sandbox do
258258
allow(metadata, sandbox)
259259
end
260260

261-
def allow(metadata, sandbox) when is_map(metadata) do
262-
allow_sandbox_access(metadata, sandbox)
263-
end
264-
265-
def allow(nil, _sandbox) do
266-
:ok
267-
end
268-
269-
defp allow_sandbox_access(%{repo: repo, owner: owner}, sandbox) do
261+
def allow(%{repo: repo, owner: owner}, sandbox) do
270262
Enum.each(List.wrap(repo), &sandbox.allow(&1, owner, self()))
271263
end
272264

273-
defp allow_sandbox_access(_metadata, _sandbox), do: nil
265+
def allow(%{}, _sandbox), do: :ok
266+
def allow(nil, _sandbox), do: :ok
274267

275268
defp parse_metadata(encoded_metadata) do
276269
encoded_metadata

0 commit comments

Comments
 (0)