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
17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/jobshop/team.rb', line 17 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
28 29 30 31 |
# File 'app/models/jobshop/team.rb', line 28 def registration_token_period_valid? registration_token_sent_at && registration_token_sent_at.utc >= 30.minutes.ago.utc end |