mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Revert "Move password_required? to authenticatable. This allow you to reuse it when building your own validations."
This reverts commit 386e7be823
.
This commit is contained in:
parent
bd4b29c0fd
commit
a53cc74fd9
2 changed files with 9 additions and 7 deletions
|
@ -94,13 +94,6 @@ module Devise
|
|||
|
||||
protected
|
||||
|
||||
# Checks whether a password is needed or not. For validations only.
|
||||
# Passwords are always required if it's a new record, or if the password
|
||||
# or confirmation are being set somewhere.
|
||||
def password_required?
|
||||
new_record? || !password.nil? || !password_confirmation.nil?
|
||||
end
|
||||
|
||||
# Digests the password using the configured encryptor.
|
||||
def password_digest(password)
|
||||
self.class.encryptor_class.digest(password, self.class.stretches, self.password_salt, self.class.pepper)
|
||||
|
|
|
@ -34,6 +34,15 @@ module Devise
|
|||
"to the following methods: #{unavailable_validations.to_sentence}."
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# Checks whether a password is needed or not. For validations only.
|
||||
# Passwords are always required if it's a new record, or if the password
|
||||
# or confirmation are being set somewhere.
|
||||
def password_required?
|
||||
new_record? || !password.nil? || !password_confirmation.nil?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue