Class: CopDetectiveValidator
Constant Summary
collapse
- @@messages =
{notice: nil}
- @@options_errors =
{option_nil: "is nil.",
empty: "is an empty string."
}
Class Method Summary
collapse
formatting, invalid_password, non_matching, options_error, unsaved_password, wrong_datatype
Class Method Details
.new_passwords_match?(password, confirmation) ⇒ Boolean
26
27
28
|
# File 'lib/validator.rb', line 26
def new_passwords_match?(password, confirmation)
password == confirmation
end
|
.valid_credentials?(user, old_password) ⇒ Boolean
22
23
24
|
# File 'lib/validator.rb', line 22
def valid_credentials?(user, old_password)
user.authenticate(old_password) == user
end
|
.validate_new_passwords(user, password, confirmation) ⇒ Object