diff --git a/config/config.exs b/config/config.exs index c7a22718..b5b702a9 100644 --- a/config/config.exs +++ b/config/config.exs @@ -8,7 +8,7 @@ import Config config :dpul_collections, - ecto_repos: [DpulCollections.Repo, DpulCollections.FiggyRepo], + ecto_repos: [DpulCollections.Repo], generators: [timestamp_type: :utc_datetime] # Configures the endpoint diff --git a/config/dev.exs b/config/dev.exs index aaf152b3..e7b07537 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -74,6 +74,9 @@ config :dpul_collections, DpulCollectionsWeb.Endpoint, ] ] +# Set environment +config :dpul_collections, :current_env, :dev + # Enable dev routes for dashboard and mailbox config :dpul_collections, dev_routes: true diff --git a/config/prod.exs b/config/prod.exs index 399fb97e..c18f97b0 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -8,6 +8,9 @@ import Config config :dpul_collections, DpulCollectionsWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" +# Set environment +config :dpul_collections, :current_env, :prod + # Configures Swoosh API Client config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: DpulCollections.Finch diff --git a/config/test.exs b/config/test.exs index e81df83f..446da69b 100644 --- a/config/test.exs +++ b/config/test.exs @@ -36,6 +36,9 @@ config :dpul_collections, DpulCollectionsWeb.Endpoint, # In test we don't send emails. config :dpul_collections, DpulCollections.Mailer, adapter: Swoosh.Adapters.Test +# Set environment +config :dpul_collections, :current_env, :test + # Disable swoosh api client as it is only required for production adapters. config :swoosh, :api_client, false diff --git a/lib/dpul_collections/application.ex b/lib/dpul_collections/application.ex index 49325dd6..ee123115 100644 --- a/lib/dpul_collections/application.ex +++ b/lib/dpul_collections/application.ex @@ -21,7 +21,7 @@ defmodule DpulCollections.Application do # {DpulCollections.Worker, arg}, # Start to serve requests, typically the last entry DpulCollectionsWeb.Endpoint - ] ++ environment_children(Mix.env()) + ] ++ environment_children(Application.fetch_env!(:dpul_collections, :current_env)) # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options