-
Notifications
You must be signed in to change notification settings - Fork 64
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
Added custom error message for validate_numeric and validate_size_of … #670
Added custom error message for validate_numeric and validate_size_of … #670
Conversation
src/avram/validations.cr
Outdated
@@ -143,11 +144,11 @@ module Avram::Validations | |||
size = attribute.value.to_s.size | |||
|
|||
if !min.nil? && size < min | |||
attribute.add_error "is too short" | |||
attribute.add_error message |
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.
These still need to have the same changes as you did below, then it will be good 👍
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.
Nice job! 🎉🎉🎉
Thanks! |
@vishalsodani woops, didn't realize that the CI wasn't running. Could you go ahead and tell ameba to ignore those issues? I might try to figure out how to fix them later but it's overkill for this change Here's docs on how to do it https://github.com/crystal-ameba/ameba#inline-disabling |
I added the ignore comments. |
Looks like the disabling didn't get put in the right place. You should be able to check it locally with |
7e0f770
to
fc700a8
Compare
Thanks for the hint. Fixed. |
…#666