Check valid options in numericality validator#32675
Check valid options in numericality validator#32675rfrm wants to merge 2 commits intorails:masterfrom
Conversation
Invalid options should not be ignored by the validator:
class User
include ActiveModel::Validations
validates_numericality_of :argument, :greather_than_or_equal_to: 0
end
The previous model will allow negative values because of
the option misspelling.
|
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @rafaelfranca (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review. Please see the contribution instructions for more information. |
|
Do you think |
eileencodes
left a comment
There was a problem hiding this comment.
Hey @rfrm thanks for the PR!
This is causing a fair amount of tests to fail https://travis-ci.org/rails/rails/jobs/369400417#L1569. Can you take a look?
Once you fix the tests can you squash your commits into one? Thanks!
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
Failing tests were never addressed so I'm going to close this one. |
Invalid options should not be ignored by the validator:
The previous model would allow negative values because of the option misspelling.
Add a check to ensure valid options are passed to the validator.