app/models/user.rb
#
# Make sure that the password is sufficient complex: at least one uppercase, one lowercase and one digit.
#
Make sure that the password is sufficient complex: at least one uppercase, one lowercase and one digit.
Make sure that the password is sufficient complex : at least one uppercase one lowercase and one digit .
def password_complexity
    if password.present? and not password.match(/\A(?=.*[a-z])(?=.*[A-Z])(?=.*\d).*/)
      errors.add :password, I18n.t('weak_password')
    end
  end
def password_complexity if password . present? and not password . match ( / \A (?=.*[a-z])(?=.*[A-Z])(?=.* \d ).* / ) errors . add :password , I18n . t ( 'weak_password' ) end end
Make sure that the password is sufficient complex: at least one uppercase, one lowercase and one digit.
Make sure that the password is sufficient complex : at least one uppercase one lowercase and one digit .