Class: Signin
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Signin
- Defined in:
- app/models/signin.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.generate_token ⇒ Object
33 34 35 |
# File 'app/models/signin.rb', line 33 def self.generate_token SecureRandom.urlsafe_base64(rand(50..100)) end |
Instance Method Details
#expire! ⇒ Object
21 22 23 24 25 26 27 |
# File 'app/models/signin.rb', line 21 def expire! update!( ip: ip, user_agent: user_agent, expiration_time: Time.current ) end |
#expired? ⇒ Boolean
29 30 31 |
# File 'app/models/signin.rb', line 29 def expired? expiration_time.past? end |