add ability to create and purchase free tickets

This commit is contained in:
Rishabh Saxena 2016-08-02 01:37:55 +05:30
parent c4938166f5
commit 4dcfc55418
No known key found for this signature in database
GPG key ID: FA3BDC38A9CB6807
2 changed files with 16 additions and 6 deletions

View file

@ -13,7 +13,7 @@ class Ticket < ActiveRecord::Base
validates :price_cents, :price_currency, :title, presence: true
validates_numericality_of :price_cents, greater_than: 0
validates_numericality_of :price_cents, greater_than_or_equal_to: 0
def bought?(user)
buyers.include?(user)