-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Fix: Fix issue with incorrect error messages #209
Fix: Fix issue with incorrect error messages #209
Conversation
@igorkasyanchuk I'll have a look at it this weekend :) |
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.
Thanks a lot for your work @jozzi05, here are some improvements and it works for me to merge it!
@igorkasyanchuk @gr8bit let us know if something is missing
looks good for me, @Mth0158 do you approve it too? |
@igorkasyanchuk fine with me, thanks again @jozzi05! |
@Mth0158 No worries, I'm happy I was able to help. Thank you for providing such a lovely gem to the open-source community. 🍻 |
Looks fine, I like the context addition! |
@igorkasyanchuk any update on this PR? 🙏 |
oh, sorry, I merged a different PR first and now this has conflicts. Can you please fix and I'll merge ASAP |
Apologies, but changes from the master branch are gigantic. I don't really have time to investigate again how the current code handles validations and where all tests are placed. Please feel free to take inspiration from my test cases for a way to reproduce issues from the latest release to know if the issue still exists on the master branch. I'm closing this PR. |
@jozzi05 sorry for the conflicts, it's due to my PR. |
This PR fixes issues with randomly generated error codes when using extra options like
:if
,:on
etc. Additionally, it adds a new extension to the size matcher that enables users to define custom validation context.Error messages:
on
exampleSize with context translation missing: en.activerecord.errors.models.size/portfolio.attributes.size_with_context.file_size_not_on
Size with context file size must be less than 2 KB (current size is 10 KB)
if
exampleSize with if translation missing: en.activerecord.errors.models.size/portfolio.attributes.size_with_if.file_size_not_if
Size with if file size must be less than 2 KB (current size is 10 KB)