Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
fix: #154 Moved Mix.env to config (#159 by @Balt87)
Browse files Browse the repository at this point in the history
  • Loading branch information
Balt87 authored and jamonholmgren committed Mar 10, 2019
1 parent edb7ccf commit 2b99fc5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ use Mix.Config

config :thesis, store: Thesis.EctoStore
config :thesis, Thesis.EctoStore, repo: MyApp.Repo
config :thesis, env: Mix.env

import_config "#{Mix.env}.exs"
4 changes: 3 additions & 1 deletion examples/example-phx-1_3/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use Mix.Config
config :example_phx,
ecto_repos: [ExamplePhx.Repo]

config :example_phx, env: Mix.env

# Configures the endpoint
config :example_phx, ExamplePhxWeb.Endpoint,
url: [host: "localhost"],
Expand Down Expand Up @@ -43,4 +45,4 @@ config :thesis, :notifications,

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env}.exs"
import_config "#{Mix.env}.exs"
2 changes: 1 addition & 1 deletion examples/example-phx-1_3/lib/example_phx/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule ExamplePhx.Application do
supervisor(ExamplePhxWeb.Endpoint, [])
# Start your own worker by calling: ExamplePhx.Worker.start_link(arg1, arg2, arg3)
# worker(ExamplePhx.Worker, [arg1, arg2, arg3]),
] ++ env_children(Mix.env)
] ++ env_children(Application.get_env(:example_phx, :env))

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
Expand Down
2 changes: 1 addition & 1 deletion lib/thesis/notifications.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule Thesis.Notifications do
"other" => []
}
|> notifications_from_host_app(conn, notifications())
|> notifications_regarding_env(Mix.env)
|> notifications_regarding_env(Application.get_env(:thesis, :env))
|> notifications_regarding_page(conn.assigns[:thesis_page])
end

Expand Down

0 comments on commit 2b99fc5

Please # to comment.