1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/models/ticket.rb
2020-03-30 11:33:12 +02:00

13 lines
488 B
Ruby

# frozen_string_literal: true
# Ticket is an reservation of a member for an Event, with a specific PriceCategory
# For example, Member John Smith smith has book 2 places on Event "Arduino initiation" at price "reduces fare"
class Ticket < ApplicationRecord
belongs_to :reservation
belongs_to :event_price_category
validates :event_price_category_id, presence: true
validates :booked, presence: true
validates :booked, numericality: { only_integer: true, greater_than: 0 }
end