Module: Devise::Models::Rememberable::ClassMethods
- Defined in:
- lib/devise/models/rememberable.rb
Instance Method Summary collapse
-
#remember_token ⇒ Object
Generate a token checking if one does not already exist in the database.
-
#serialize_from_cookie(id, remember_token) ⇒ Object
Recreate the user based on the stored cookie.
-
#serialize_into_cookie(record) ⇒ Object
Create the cookie key using the record id and remember_token.
Instance Method Details
#remember_token ⇒ Object
Generate a token checking if one does not already exist in the database.
113 114 115 |
# File 'lib/devise/models/rememberable.rb', line 113 def remember_token generate_token(:remember_token) end |
#serialize_from_cookie(id, remember_token) ⇒ Object
Recreate the user based on the stored cookie
106 107 108 109 110 |
# File 'lib/devise/models/rememberable.rb', line 106 def (id, remember_token) conditions = { :id => id, :remember_token => remember_token } record = find(:first, :conditions => conditions) record if record && !record.remember_expired? end |
#serialize_into_cookie(record) ⇒ Object
Create the cookie key using the record id and remember_token
101 102 103 |
# File 'lib/devise/models/rememberable.rb', line 101 def (record) [record.id, record.remember_token] end |