Comparison Validator Also Validates Presence
In ActiveModel, a comparison validation on an attribute will first perform a presence validation, and return a :blank
error if the attribute is missing. So you don't have to explicitly add a presence validation if you're also doing a comparison validation (unless you really really want to (I probably still will)).
If you don't provide some_number
you'll get a :blank
error, and the comparison validation will not run:
But if you do provide some_number
, then the comparison validation will run as expected: