mirror of https://github.com/rails/rails
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:
parent
43f1b23a75
commit
cec60d3989
|
@ -26,8 +26,6 @@ module ActiveModel
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue