module Devise::Models::DatabaseAuthenticatable::ClassMethods

def authenticate(attributes={})

authenticated user if it's valid or nil.
Authenticate a user based on configured attribute keys. Returns the
def authenticate(attributes={})
  return unless authentication_keys.all? { |k| attributes[k].present? }
  conditions = attributes.slice(*authentication_keys)
  resource = find_for_authentication(conditions)
  resource if resource.try(:valid_for_authentication?, attributes)
end

def encryptor_class

Returns the class for the configured encryptor.
def encryptor_class
  @encryptor_class ||= ::Devise::Encryptors.const_get(encryptor.to_s.classify)
end

def find_for_authentication(conditions)


end
find(:first, :conditions => conditions)
conditions[:active] = true
def self.find_for_authentication(conditions={})

Example:
namedscope to filter records while authenticating.
Overwrite to add customized conditions, create a join, or maybe use a
Find first record based on conditions given (ie by the sign in form).
def find_for_authentication(conditions)
  find(:first, :conditions => conditions)
end