diff options
Diffstat (limited to 'activemodel/lib/active_model/secure_password.rb')
-rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index 54191f41df..3e7d3174ac 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -62,9 +62,9 @@ module ActiveModel private def password_must_be_strong - if @password.present? - errors.add(:password, "must be longer than 6 characters") unless @password.size > 6 - errors.add(:password, "is a too weak and common") if WEAK_PASSWORDS.include?(@password) + if password.present? + errors.add(:password, "must be longer than 6 characters") unless password.size > 6 + errors.add(:password, "is too weak and common") if WEAK_PASSWORDS.include?(password) end end end |