diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2016-08-28 00:37:10 -0500 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2016-08-28 00:37:10 -0500 |
commit | cec60d39891650c96f008aadcb49c249626da3f5 (patch) | |
tree | 19f1a1eccc5e4d3f97273a51d21fa4ca981c6ba1 /activemodel/lib/active_model/validations | |
parent | 43f1b23a75198b2e57d305e8bd4f81ce7489a81e (diff) | |
download | rails-cec60d39891650c96f008aadcb49c249626da3f5.tar.gz rails-cec60d39891650c96f008aadcb49c249626da3f5.tar.bz2 rails-cec60d39891650c96f008aadcb49c249626da3f5.zip |
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.
Diffstat (limited to 'activemodel/lib/active_model/validations')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index af27955554..48e0e5c9f6 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -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 |