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

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

Overview

Instance level methods for the perishable token.

Instance Method Summary collapse

Instance Method Details

#disable_perishable_token_maintenance?Boolean

A convenience method based on the disable_perishable_token_maintenance configuration option.

Returns:

  • (Boolean)


98
99
100
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 98

def disable_perishable_token_maintenance?
  self.class.disable_perishable_token_maintenance == true
end

#reset_perishable_tokenObject

Resets the perishable token to a random friendly token.



87
88
89
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 87

def reset_perishable_token
  self.perishable_token = Random.friendly_token
end

#reset_perishable_token!Object

Same as reset_perishable_token, but then saves the record afterwards.



92
93
94
95
# File 'lib/authlogic/acts_as_authentic/perishable_token.rb', line 92

def reset_perishable_token!
  reset_perishable_token
  save_without_session_maintenance(ActiveRecord::VERSION::STRING >= "3.0" ? { :validate => false } : false)
end