Sha256: e1e69b43a26e1211361e5163adf99d8153da87bab260e672be112380ba068553
Contents?: true
Size: 668 Bytes
Versions: 8
Compression:
Stored size: 668 Bytes
Contents
module Jobshop class Team < ApplicationRecord belongs_to :owner, class_name: "Jobshop::User", optional: true has_many :users, class_name: "Jobshop::User" has_one :default_dashboard, class_name: "Jobshop::Dashboard" 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 def registration_token_period_valid? registration_token_sent_at && registration_token_sent_at.utc >= 30.minutes.ago.utc end end end
Version data entries
8 entries across 8 versions & 1 rubygems