Module: Sorcery::Model::Submodules::RememberMe::InstanceMethods
- Defined in:
- lib/sorcery/model/submodules/remember_me.rb
Instance Method Summary collapse
-
#forget_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘forget_me!’ method.
-
#remember_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘remember_me!’ method.
Instance Method Details
#forget_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘forget_me!’ method.
51 52 53 54 55 56 |
# File 'lib/sorcery/model/submodules/remember_me.rb', line 51 def forget_me! config = sorcery_config self.send(:"#{config.remember_me_token_attribute_name}=", nil) self.send(:"#{config.remember_me_token_expires_at_attribute_name}=", nil) self.save!(:validate => false) end |
#remember_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘remember_me!’ method.
43 44 45 46 47 48 |
# File 'lib/sorcery/model/submodules/remember_me.rb', line 43 def remember_me! config = sorcery_config self.send(:"#{config.remember_me_token_attribute_name}=", generate_random_token) self.send(:"#{config.remember_me_token_expires_at_attribute_name}=", Time.now + config.remember_me_for) self.save!(:validate => false) end |