module Authlogic::Session::Scopes::InstanceMethods

Public Class Methods

new(*args) click to toggle source

Setting the scope if it exists upon instantiation.

Calls superclass method
# File lib/authlogic/session/scopes.rb, line 79
def initialize(*args)
  self.scope = self.class.scope
  super
end

Public Instance Methods

scope() click to toggle source

The scope of the current object

# File lib/authlogic/session/scopes.rb, line 85
def scope
  @scope ||= {}
end

Private Instance Methods

build_key(last_part) click to toggle source

Used for things like cookie_key, session_key, etc.

Calls superclass method
# File lib/authlogic/session/scopes.rb, line 91
def build_key(last_part)
  [scope[:id], super].compact.join("_")
end
search_for_record(*args) click to toggle source
# File lib/authlogic/session/scopes.rb, line 95
def search_for_record(*args)
  session_scope = if scope[:find_options].is_a?(ActiveRecord::Relation)
    scope[:find_options]
  else
    klass.send(:where, scope[:find_options] && scope[:find_options][:conditions] || {})
  end
  session_scope.scoping do
    klass.send(*args)
  end
end