mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-03-21 21:41:48 +00:00
15 lines
365 B
Elixir
15 lines
365 B
Elixir
defmodule API.Sandbox do
|
|
@moduledoc """
|
|
A set of helpers that allow Phoenix components (Channels) to access SQL sandbox in test environment.
|
|
"""
|
|
alias Domain.Sandbox
|
|
|
|
def allow_sql_sandbox(socket) do
|
|
if Map.has_key?(socket.assigns, :user_agent) do
|
|
Sandbox.allow(Phoenix.Ecto.SQL.Sandbox, socket.assigns.user_agent)
|
|
end
|
|
|
|
socket
|
|
end
|
|
end
|