Add (admin-only) tickets via 'visibile' attribute [migration]

(cherry picked from commit ce0db3d7a736e7bcde480721986dbfb4a82aa083)
This commit is contained in:
James Mason 2018-04-09 11:53:31 -07:00
parent 1fcd5c68c5
commit 26f0377c76
No known key found for this signature in database
GPG key ID: 1B3951886C449023
15 changed files with 56 additions and 10 deletions

View file

@ -18,6 +18,8 @@ class Ticket < ApplicationRecord
validates :price_cents, numericality: { greater_than_or_equal_to: 0 }
scope :visible, -> { where(visible: true) }
def bought?(user)
buyers.include?(user)
end