Added Poison as dependency #14
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @JakeStaTeresa I’m back with my fix :)
Until today we were using my fix branch of Currencies and I wanted to update Currencies to the newest version. Unfortunately the
UndefinedFunctionErrorexception was still there.So I started to investigate why this exception was thrown. In #12
ensure_compiled/1was added to ensure that@currenciesisn’t set when the dependencyPoisonisn’t compiled first.To come back to the
ensure_compiled/1function, this function return an tuple with{:module, module}or{:error, :embedded | :badfile | :nofile | :on_load_failure}. I’ve tested what this if-statement does with these tuples,As you see in this example, it returns
trueeven when there’s an error.A better way to catch this is by using the
ensure_compiled?/1function.So I tried to use this function and let my application compile again hoping that this was fixed now. My conclusion of using
ensure_compiled?/1is that the application will be compiled! :) Unfortunately@currencieswasnil, because Poison wasn’t compiled before Currencies. I also received an warning because the@currenciesattribute wasn’t set at compile time.When using Currencies in an application, you should also have Poison in your dependencies. Otherwise the attribute
@currencieswon’t be set at compile time. This makes Currencies dependent on Poison.Hopefully I explained this time better why this dependency should have Poison as an dependency. Thanks for creating this dependency ❤️