Class/Module Index [+]

Quicksearch

Authlogic::Session::Klass::Config

Public Instance Methods

authenticate_with(klass) click to toggle source

Lets you change which model to use for authentication.

  • Default: inferred from the class name. UserSession would automatically try User

  • Accepts: an ActiveRecord class

# File lib/authlogic/session/klass.rb, line 21
def authenticate_with(klass)
  @klass_name = klass.name
  @klass = klass
end
Also aliased as: authenticate_with=
authenticate_with=(klass) click to toggle source
Alias for: authenticate_with
klass() click to toggle source

The name of the class that this session is authenticating with. For example, the UserSession class will authenticate with the User class unless you specify otherwise in your configuration. See authenticate_with for information on how to change this value.

# File lib/authlogic/session/klass.rb, line 30
def klass
  @klass ||= klass_name ? klass_name.constantize : nil
end
klass_name() click to toggle source

The string of the model name class guessed from the actual session class name.

# File lib/authlogic/session/klass.rb, line 35
def klass_name
  return @klass_name if defined?(@klass_name)
  @klass_name = name.scan(/(.*)Session/)[0]
  @klass_name = klass_name ? klass_name[0] : nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.