Module: Authlogic::ActsAsAuthentic::SingleAccessToken::Methods

Defined in:
lib/authlogic/acts_as_authentic/single_access_token.rb

Overview

All method, for the single_access token aspect of acts_as_authentic.

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/authlogic/acts_as_authentic/single_access_token.rb', line 30

def self.included(klass)
  return if !klass.column_names.include?("single_access_token")
  
  klass.class_eval do
    include InstanceMethods
    validates_uniqueness_of :single_access_token, :if => :single_access_token_changed?
    before_validation :reset_single_access_token, :if => :reset_single_access_token?
    after_password_set(:reset_single_access_token, :if => :change_single_access_token_with_password?) if respond_to?(:after_password_set)
  end
end