Browse files

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.
  • Loading branch information...
guilleiguaran committed Aug 28, 2016
1 parent 43f1b23 commit cec60d39891650c96f008aadcb49c249626da3f5
Showing with 0 additions and 2 deletions.
  1. +0 −2 activemodel/lib/active_model/validations/numericality.rb
@@ -26,8 +26,6 @@ def validate_each(record, attr_name, value)
raw_value = value
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))

0 comments on commit cec60d3

Please sign in to comment.