Class: Authlogic::Session::AuthenticatesManyAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/authlogic/session/authenticates_many_association.rb

Overview

Authenticates Many Association

An object of this class is used as a proxy for the authenticates_many relationship. It basically allows you to “save” scope details and call them on an object, which allows you to do the following:

@account.user_sessions.new
@account.user_sessions.find
# ... etc

You can call all of the class level methods off of an object with a saved scope, so that calling the above methods scopes the user sessions down to that specific account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass, find_options, id) ⇒ AuthenticatesManyAssociation

Returns a new instance of AuthenticatesManyAssociation.



15
16
17
18
19
# File 'lib/authlogic/session/authenticates_many_association.rb', line 15

def initialize(klass, find_options, id)
  self.klass = klass
  self.find_options = find_options
  self.id = id
end

Instance Attribute Details

#find_optionsObject

:nodoc:



13
14
15
# File 'lib/authlogic/session/authenticates_many_association.rb', line 13

def find_options
  @find_options
end

#idObject

:nodoc:



13
14
15
# File 'lib/authlogic/session/authenticates_many_association.rb', line 13

def id
  @id
end

#klassObject

:nodoc:



13
14
15
# File 'lib/authlogic/session/authenticates_many_association.rb', line 13

def klass
  @klass
end