Sha256: acf9412ea5b9b254754d0f03bb75af8a9169de7d76233c481a47fd38f23d22dc

Contents?: true

Size: 437 Bytes

Versions: 9

Compression:

Stored size: 437 Bytes

Contents

class CASino::ProxyGrantingTicket < ActiveRecord::Base
  include CASino::ModelConcern::Ticket

  self.ticket_prefix = 'PGT'.freeze

  before_validation :ensure_iou_present

  validates :ticket, uniqueness: true
  validates :iou, uniqueness: true

  belongs_to :granter, polymorphic: true
  has_many :proxy_tickets, dependent: :destroy

  private
  def ensure_iou_present
    self.iou ||= create_random_ticket_string('PGTIOU')
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
casino-4.1.2 app/models/casino/proxy_granting_ticket.rb
casino-4.1.1 app/models/casino/proxy_granting_ticket.rb
casino-4.1.0 app/models/casino/proxy_granting_ticket.rb
casino-4.0.3 app/models/casino/proxy_granting_ticket.rb
casino-4.0.2 app/models/casino/proxy_granting_ticket.rb
casino-4.0.1 app/models/casino/proxy_granting_ticket.rb
casino-4.0.0 app/models/casino/proxy_granting_ticket.rb
casino-4.0.0.pre.2 app/models/casino/proxy_granting_ticket.rb
casino-4.0.0.pre.1 app/models/casino/proxy_granting_ticket.rb