From 869a90512f36b04914d73cbf58317d953caea7c5 Mon Sep 17 00:00:00 2001 From: Kuldeep Aggarwal Date: Sun, 14 Sep 2014 00:19:33 +0530 Subject: use `allow_blank` option instead --- activemodel/lib/active_model/secure_password.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activemodel/lib/active_model') diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index f6ad35769f..8f2a069ba3 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -75,7 +75,7 @@ module ActiveModel end validates_length_of :password, maximum: ActiveModel::SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED - validates_confirmation_of :password, if: ->{ password.present? } + validates_confirmation_of :password, allow_blank: true end # This code is necessary as long as the protected_attributes gem is supported. -- cgit v1.2.3