-
Notifications
You must be signed in to change notification settings - Fork 12
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
Support custom regex for validation via config #84
Conversation
assert errors_on(changeset_2) == %{hash: ["has invalid format"]} | ||
|
||
Application.delete_env(:goal, :custom_regex) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've choose to do a hash regex validation here, not sure if this is the best approach, lmk
Hey! Thanks for your PR. I'm okay with this solution as a workaround to #64. When that issue is resolved, then this workaround is liable to be removed in a major version update. |
Ok! Sounds good! I've fixed the failed CI error, should be good to go now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👏🏻
Published the new version on Hex: https://hex.pm/packages/goal/0.3.2 |
Hi @lucca65! I'm preparing a version that includes support for passing module attributes to the schema. I know I said that this feature that was introduced may be removed when that support is added, but I see no harm in keeping it and I think it is a useful addition. So the feature will stay in version 1.0.0 🙇🏻 |
This is nice! Thanks for the headsup! I'll update my deps as soon as I get the release notifications and will let you know if I stumble upon any issues! Happy to know the library is moving forward to 1.0.0!! 🎉 |
Hello there!
I'm a user of this library, its been amazing so far. I love how declarative it is with macros!
However, in my use case, I needed to run custom regex's, which are different from the default ones provided.
I've changed it so those custom regex could live together with the customized
email
,uuid
, in the Configuration. Maybe we could have another mechanism to send custom regex directly, but this use case is perfect for me since my regex's never change nor come from the client.Configure new regex
In the configuration file
Use it inside
defparams
:I think this is pretty and idiomatic, while keeping the same structure the library already have.
Let me know your thoughts!