Class: PasswordValidator

Inherits:
BaseValidator
  • Object
show all
Defined in:
lib/lite/validators/password_validator.rb

Constant Summary collapse

REGEXP =
{
  strong: /\A(?=.{4,255})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[[:^alnum:]])/x,
  weak: /^[A-Za-z0-9.,<>:;!@#$%^&*?_~-]{1,255}$/
}.freeze

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



10
11
12
13
# File 'lib/lite/validators/password_validator.rb', line 10

def validate_each(record, attribute, value)
  assert_valid_strength!
  super
end