module Authlogic::ActsAsAuthentic::PerishableToken::Methods

All methods relating to the perishable token.

Public Class Methods

included(klass) click to toggle source
# File lib/authlogic/acts_as_authentic/perishable_token.rb, line 54
def self.included(klass)
  return unless klass.column_names.include?("perishable_token")

  klass.class_eval do
    extend ClassMethods
    include InstanceMethods

    validates_uniqueness_of :perishable_token, case_sensitive: true,
                                               if: :will_save_change_to_perishable_token?
    before_save :reset_perishable_token, unless: :disable_perishable_token_maintenance?
  end
end