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

Not working, when deployed using EXRM #1

Open
ksakhamuri opened this issue Jun 4, 2016 · 2 comments · May be fixed by #6
Open

Not working, when deployed using EXRM #1

ksakhamuri opened this issue Jun 4, 2016 · 2 comments · May be fixed by #6

Comments

@ksakhamuri
Copy link

The helper function uri seems to depend on Mix.env, which is not available when deployed using exrm. This needs to be changed to work using config variables.

@ksakhamuri ksakhamuri changed the title Now working, when deployed using EXRM Not working, when deployed using EXRM Jun 4, 2016
@ksakhamuri
Copy link
Author

I have a simple fix for this, that checks for the presence of a config value and matches to :test, if exists. I don't seem to have privileges to contributing a fix. Will appreciate if you can either give me permissions to contributing or if you can fix this.

Here is my change:

  defp uri() do
    if config(:mix_env) && config(:mix_env) === :test do
      config :test_server_uri
    else
      @uris[config(:environment)]
    end
  end

@marcelog
Copy link
Owner

marcelog commented Jun 4, 2016

Hi @ksakhamuri!

To contribute you can:
1.- Fork the project so you have a copy of the repo in your own account (see: https://help.github.com/articles/fork-a-repo/).
2.- Create a branch with your changes (see: https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging).
3.- Open a pull request from that branch to the master branch of this repo. You don't need any special privileges for that since you will be uploading the changes to your own repo and I can merge them once the pull request is opened and reviewed (see: https://help.github.com/articles/using-pull-requests/).

I still haven't used exrm myself but I see your point. Thing is, your patch doesn't work because mix_env is not inside the config section of the elixir_authorizenet app, it's an environment variable.

You can however, open a pull request once you have a change that will pass the unit tests and also works in your exrm releases.

Best Regards!

kiere referenced this issue in kiere/elixir_authorizenet Aug 21, 2018
When using releases, the `Mix` module is not available and the app will crash when reading the `uri()` function.  This change modifies `uri()` to test for what it really cares about which is the existence of a config option called `:test_server_uri` which is dynamically built in the test setup.  Resolves #1.
@aptinio aptinio linked a pull request Feb 9, 2021 that will close this issue
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 a pull request may close this issue.

2 participants