Sha256: 6c4f9224b41a0e2741cfcf97d17437a45a3b2c8efb1be90d7332b32eb4a08f76
Contents?: true
Size: 396 Bytes
Versions: 49
Compression:
Stored size: 396 Bytes
Contents
module Adeia class Token < ActiveRecord::Base belongs_to :permission, foreign_key: :adeia_permission_id validates :permission, presence: true validates :exp_at, presence: true before_create :generate_token def is_valid? exp_at > Time.now && is_valid end private def generate_token self.token = SecureRandom.urlsafe_base64 end end end
Version data entries
49 entries across 49 versions & 1 rubygems