Sha256: 65b33d8f665cd4c89db6bbfbcf549ce366681361ba94c01f033d5c4f795151b8
Contents?: true
Size: 718 Bytes
Versions: 2
Compression:
Stored size: 718 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" validates :name, presence: true, on: :update 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jobshop-0.0.29 | app/models/jobshop/team.rb |
jobshop-0.0.23 | app/models/jobshop/team.rb |