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

Add after compile validation check to ensure all fields and assocs have been defined #376

Merged
merged 1 commit into from
Jan 25, 2020

Conversation

danschultzer
Copy link
Collaborator

@danschultzer danschultzer commented Jan 8, 2020

Based on suggestion by @josevalim.

This adds an @after_compile validation check to ensure all assocs and fields used by Pow and its extensions has been defined. This way devs are no longer dependent on using pow_user_fields/0, as Pow.Ecto.Schema will raise an error on compile-time to ensure all fields are defined.

This paves the road to get rid of pow_user_fields/0 and let devs explicitly list all assocs and fields. The thing that holds me back is to still keep Pow super easy to set up. If the assocs and fields have to be explicitly listed, then adding extensions would require additional steps to get working.

@danschultzer danschultzer force-pushed the ecto-after-compile branch 2 times, most recently from d60de2c to 5aa502a Compare January 8, 2020 23:07
@danschultzer danschultzer marked this pull request as ready for review January 10, 2020 23:39
@danschultzer danschultzer force-pushed the ecto-after-compile branch 3 times, most recently from f18e376 to 4d25d31 Compare January 16, 2020 21:32
CHANGELOG.md Outdated Show resolved Hide resolved
@danschultzer danschultzer merged commit 1eedc64 into master Jan 25, 2020
@danschultzer danschultzer deleted the ecto-after-compile branch January 25, 2020 03:05
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