Module: Devise::Models::Rememberable::ClassMethods
- Defined in:
- lib/devise/models/rememberable.rb
Instance Method Summary collapse
-
#serialize_from_cookie(cookie) ⇒ 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
#serialize_from_cookie(cookie) ⇒ Object
Recreate the user based on the stored cookie
84 85 86 87 88 |
# File 'lib/devise/models/rememberable.rb', line 84 def () record_id, record_token = .split('::') record = find(:first, :conditions => { :id => record_id }) if record_id record if record.try(:valid_remember_token?, record_token) end |
#serialize_into_cookie(record) ⇒ Object
Create the cookie key using the record id and remember_token
79 80 81 |
# File 'lib/devise/models/rememberable.rb', line 79 def (record) "#{record.id}::#{record.remember_token}" end |