From 3800be62c249596cb139d580ce3516ff4b989176 Mon Sep 17 00:00:00 2001 From: Mat Trudel Date: Sun, 22 Jun 2025 21:40:55 -0400 Subject: [PATCH] Allow passing through opts in Ecto.Adapters.SQL.Sandbox.allow/4 calls --- lib/ecto/adapters/sql/sandbox.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ecto/adapters/sql/sandbox.ex b/lib/ecto/adapters/sql/sandbox.ex index 5aaf1942..b2527653 100644 --- a/lib/ecto/adapters/sql/sandbox.ex +++ b/lib/ecto/adapters/sql/sandbox.ex @@ -597,10 +597,11 @@ defmodule Ecto.Adapters.SQL.Sandbox do """ @spec allow(Ecto.Repo.t() | pid(), pid(), term()) :: :ok | {:already, :owner | :allowed} | :not_found - def allow(repo, parent, allow, _opts \\ []) when is_atom(repo) or is_pid(repo) do + def allow(repo, parent, allow, opts \\ []) when is_atom(repo) or is_pid(repo) do case GenServer.whereis(allow) do pid when is_pid(pid) -> - %{pid: pool, opts: opts} = lookup_meta!(repo) + %{pid: pool, opts: meta_opts} = lookup_meta!(repo) + opts = Keyword.merge(meta_opts, opts) DBConnection.Ownership.ownership_allow(pool, parent, pid, opts) other ->