Sha256: 1d42cf2604e4bb147d069bd43681591cad43f1a262cf5759fa0db1bfcb328954
Contents?: true
Size: 418 Bytes
Versions: 10
Compression:
Stored size: 418 Bytes
Contents
module Notee class Token < ActiveRecord::Base # callbacks before_create :generate_access_token before_create :set_expires_at private def generate_access_token begin self.access_token = SecureRandom.hex end while self.class.exists?(access_token: access_token) end def set_expires_at self.expires_at = Time.current + (60 * 60 * 24 * 7) #7日 end end end
Version data entries
10 entries across 10 versions & 1 rubygems