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(rememberable) ⇒ 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
85 86 87 88 89 |
# File 'lib/devise/models/rememberable.rb', line 85 def () rememberable_id, remember_token = .split('::') rememberable = find_by_id(rememberable_id) if rememberable_id rememberable if rememberable.try(:valid_remember_token?, remember_token) end |
#serialize_into_cookie(rememberable) ⇒ Object
Create the cookie key using the record id and remember_token
80 81 82 |
# File 'lib/devise/models/rememberable.rb', line 80 def (rememberable) "#{rememberable.id}::#{rememberable.remember_token}" end |