Skip to content

Instantly share code, notes, and snippets.

@tokafish
Last active February 26, 2016 17:36
Show Gist options
  • Save tokafish/e97d2247452a96340bb0 to your computer and use it in GitHub Desktop.
Save tokafish/e97d2247452a96340bb0 to your computer and use it in GitHub Desktop.
defmodule Phoenix.Ecto.SQL.Sandbox do
import Plug.Conn
@cookie_name "phoenix.ecto.sql.sandbox"
def init(opts), do: opts
def call(%{request_path: @config_path <> configuration} = conn, _opts) do
conn |> put_resp_cookie(@cookie_name, configuration) |> send_resp(200, "OK") |> halt
end
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment