We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e223a37 commit ef5d291Copy full SHA for ef5d291
lib/ecto/adapters/sql/sandbox.ex
@@ -646,8 +646,11 @@ defmodule Ecto.Adapters.SQL.Sandbox do
646
meta
647
end
648
649
- defp find_repo(repo) when is_atom(repo), do: repo.get_dynamic_repo()
650
- defp find_repo(repo), do: repo
+ defp find_repo(repo) do
+ if is_atom(repo) and Code.ensure_loaded?(repo),
651
+ do: repo.get_dynamic_repo(),
652
+ else: repo
653
+ end
654
655
defp post_checkout(conn_mod, conn_state, opts) do
656
case conn_mod.handle_begin([mode: :transaction] ++ opts, conn_state) do
0 commit comments