Module: Authlogic::AuthenticatesMany

Defined in:
lib/novelys_authlogic/authenticates_many/base.rb,
lib/novelys_authlogic/authenticates_many/association.rb

Overview

This allows you to scope your authentication. For example, let’s say all users belong to an account, you want to make sure only users that belong to that account can actually login into that account. Simple, just do:

class Account < ActiveRecord::Base
  authenticates_many :user_sessions
end

Now you can scope sessions just like everything else in ActiveRecord:

@account.user_sessions.new(*args)
@account.user_sessions.create(*args)
@account.user_sessions.find(*args)
# ... etc

Checkout the authenticates_many method for a list of options. You may also want to checkout Authlogic::ActsAsAuthentic::Scope to scope your model.

Defined Under Namespace

Modules: Base Classes: Association