Skip to content

Commit

Permalink
use allow_blank option instead
Browse files Browse the repository at this point in the history
  • Loading branch information
kuldeepaggarwal committed Sep 13, 2014
1 parent 75e06a1 commit 869a905
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/secure_password.rb
Expand Up @@ -75,7 +75,7 @@ def has_secure_password(options = {})
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.
Expand Down

0 comments on commit 869a905

Please sign in to comment.