Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes defaults not being overriden by config #2

Merged
merged 3 commits into from
Jun 27, 2016

Conversation

victorsolis
Copy link
Collaborator

This also adds an error when Authsense is not configured at compile time. It was previously raising a no match error at runtime when it wasn't configured.

password: "postgres",
database: "authsense_test",
size: 10
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw:

database_url = System.get_env("DATABASE_URL") || "postgres://postgres:postgres@localhost/authsense_test"

config :authsense, Authsense.Test.Repo,
  url: database_url

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...but that maybe for another PR, i dunno

@victorsolis
Copy link
Collaborator Author

As per thy bidding

** (Authsense.MultipleResourcesException) Multiple resources are configured.

    Authsense cannot determine which resource module to use.
    Available resource modules: [Admin, User]

    lib/authsense.ex:138: Authsense.config/1

use Mix.Config

config :authsense, Authsense.Test.User,
repo: Authsense.Test.Repo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is the dev environment ever used in a Hex package like this?

@rstacruz
Copy link
Owner

The existence of config/dev.exs is very strange to me (it's not like Authsense has a development mode), but lemme merge and release this nonetheless. Great work. Reviewed and merged. Thank you for your contribution. 💚

@rstacruz rstacruz merged commit 46857cd into rstacruz:master Jun 27, 2016
@victorsolis
Copy link
Collaborator Author

config/dev.exs is just there so you don't get an exception when you run iex -S mix.

I am humbled by your appreciation. :shipit:

@rstacruz
Copy link
Owner

Ah, right, carry on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants