diff options
| author | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2014-09-14 00:19:33 +0530 |
|---|---|---|
| committer | Kuldeep Aggarwal <kd.engineer@yahoo.co.in> | 2014-09-14 00:19:33 +0530 |
| commit | 869a90512f36b04914d73cbf58317d953caea7c5 (patch) | |
| tree | ba9a6517b3e2a71ef17da7212ba9b6cd96427e73 | |
| parent | 75e06a197ffb493c7ce9edc1579c1fc8cb5381d7 (diff) | |
| download | rails-869a90512f36b04914d73cbf58317d953caea7c5.tar.gz rails-869a90512f36b04914d73cbf58317d953caea7c5.tar.bz2 rails-869a90512f36b04914d73cbf58317d953caea7c5.zip | |
use `allow_blank` option instead
| -rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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. |
