Module | Devise::Models::DatabaseAuthenticatable |
In: |
lib/devise/models/database_authenticatable.rb
|
Authenticatable Module, responsible for encrypting password and validating authenticity of a user while signing in.
DatabaseAuthenticable adds the following options to devise_for:
* +pepper+: a random string used to provide a more secure hash. Use `rake secret` to generate new keys. * +stretches+: the cost given to bcrypt.
User.find(1).valid_password?('password123') # returns true/false
Update record attributes when :current_password matches, otherwise returns error on :current_password. It also automatically rejects :password and :password_confirmation if they are blank.
Updates record attributes without asking for the current password. Never allows to change the current password. If you are using this method, you should probably override this method to protect other attributes you would not like to be updated without a password.
Example:
def update_without_password(params={}) params.delete(:email) super(params) end