validate_each in NumericalityValidator is never called in this case.

NumericalityValidator#validate_each is never called when allow_nil is true and
the value is nil because it is already skipped in EachValidator#validate.
This commit is contained in:
Guillermo Iguaran 2016-08-28 00:37:10 -05:00
parent 43f1b23a75
commit cec60d3989

@ -26,8 +26,6 @@ def validate_each(record, attr_name, value)
raw_value = value
end
return if options[:allow_nil] && raw_value.nil?
unless is_number?(raw_value)
record.errors.add(attr_name, :not_a_number, filtered_options(raw_value))
return