diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-11-05 19:19:41 +0000 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2017-11-05 19:24:49 +0000 |
commit | 7308991630af3fb8a2a7e2cde9fd322316153ec2 (patch) | |
tree | 86ce771e20e948280cabefb4265b9a6121beae59 /activemodel/lib/active_model | |
parent | 03ac95a14058a871bff6b78d69c77436544635c6 (diff) | |
download | rails-7308991630af3fb8a2a7e2cde9fd322316153ec2.tar.gz rails-7308991630af3fb8a2a7e2cde9fd322316153ec2.tar.bz2 rails-7308991630af3fb8a2a7e2cde9fd322316153ec2.zip |
Execute `ConfirmationValidator` validation when `_confirmation`'s value is `false`
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/validations/confirmation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb index 0abec56b68..1b5d5b09ab 100644 --- a/activemodel/lib/active_model/validations/confirmation.rb +++ b/activemodel/lib/active_model/validations/confirmation.rb @@ -9,7 +9,7 @@ module ActiveModel end def validate_each(record, attribute, value) - if (confirmed = record.send("#{attribute}_confirmation")) + unless (confirmed = record.send("#{attribute}_confirmation")).nil? unless confirmation_value_equal?(record, attribute, value, confirmed) human_attribute_name = record.class.human_attribute_name(attribute) record.errors.add(:"#{attribute}_confirmation", :confirmation, options.except(:case_sensitive).merge!(attribute: human_attribute_name)) |