aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2014-09-13 19:23:00 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2014-09-13 19:23:00 -0300
commitafc213773c71420f50ffbc5809303616cb09f504 (patch)
treed3b3df13bf34490707fb0119cef2414c4fe40917
parent1d4d15a48d0e422ae3a51920fbf055b0963917fa (diff)
parent869a90512f36b04914d73cbf58317d953caea7c5 (diff)
downloadrails-afc213773c71420f50ffbc5809303616cb09f504.tar.gz
rails-afc213773c71420f50ffbc5809303616cb09f504.tar.bz2
rails-afc213773c71420f50ffbc5809303616cb09f504.zip
Merge pull request #16910 from kuldeepaggarwal/use-rails-options
use `allow_blank` option instead of custom condition
-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.