Module: Authlogic::ActsAsAuthentic::PerishableToken::Methods

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

Overview

All methods relating to the perishable token.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



41
42
43
44
45
46
47
48
49
50
51
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 41

def self.included(klass)
  return if !klass.column_names.include?("perishable_token")

  klass.class_eval do
    extend ClassMethods
    include InstanceMethods

    validates_uniqueness_of :perishable_token, :if => :perishable_token_changed?
    before_save :reset_perishable_token, :unless => :disable_perishable_token_maintenance?
  end
end