aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorKuldeep Aggarwal <kd.engineer@yahoo.co.in>2014-09-14 00:19:33 +0530
committerKuldeep Aggarwal <kd.engineer@yahoo.co.in>2014-09-14 00:19:33 +0530
commit869a90512f36b04914d73cbf58317d953caea7c5 (patch)
treeba9a6517b3e2a71ef17da7212ba9b6cd96427e73 /activemodel
parent75e06a197ffb493c7ce9edc1579c1fc8cb5381d7 (diff)
downloadrails-869a90512f36b04914d73cbf58317d953caea7c5.tar.gz
rails-869a90512f36b04914d73cbf58317d953caea7c5.tar.bz2
rails-869a90512f36b04914d73cbf58317d953caea7c5.zip
use `allow_blank` option instead
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/secure_password.rb2
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.