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

Remove repo module attribute from version_queries #55

Merged
merged 2 commits into from
Jun 29, 2019

Conversation

FlorianGerhardt
Copy link
Contributor

@FlorianGerhardt FlorianGerhardt commented Jun 24, 2019

This PR removes the @repo module attribute from VersionQueries.
I had the problem

** (UndefinedFunctionError) function Repo.all/1 is undefined (module Repo is not available)

when I used distillery to create a release.
Compared to other libraries, the usage of module attributes seems to be the difference so I tried to replace them and it worked.
I am still pretty new to Elixir and not sure what exactly the problem was, but my guess is that Distillery compiles every file beforehand and according to this: https://elixir-lang.org/getting-started/module-attributes.html#as-constants

Every time an attribute is read inside a function, a snapshot of its current value is taken. In other words, the value is read at compilation time and not at runtime.
it looked like the Repo module was not defined at compilation time.

@izelnakri
Copy link
Owner

Thanks for the fix @FlorianGerhardt ! I will very likely merge this PR, will do a more in-depth check in few days. Meanwhile feel free to add yourself to credits ;)

@izelnakri izelnakri merged commit 7aa2f43 into izelnakri:master Jun 29, 2019
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.

None yet

2 participants