Class: Jobshop::Team
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Jobshop::Team
- Defined in:
- app/models/jobshop/team.rb
Instance Method Summary collapse
Instance Method Details
#generate_registration_token ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/models/jobshop/team.rb', line 7 def generate_registration_token raw, encrypted = Devise.token_generator.generate( self.class, :registration_token) self.registration_token = encrypted self.registration_token_sent_at = Time.now.utc self.save(validate: false) raw end |
#registration_token_period_valid? ⇒ Boolean
18 19 20 21 |
# File 'app/models/jobshop/team.rb', line 18 def registration_token_period_valid? registration_token_sent_at && registration_token_sent_at.utc >= 30.minutes.ago.utc end |