use short-form presence validator.

use two-argument form.
add unpaid scope.
repair tests.
This commit is contained in:
Rishabh Saxena 2016-07-08 23:07:17 +05:30
parent 893f517ab0
commit 888c7a8524
6 changed files with 24 additions and 36 deletions

View file

@ -13,6 +13,8 @@ class TicketPurchase < ActiveRecord::Base
delegate :price_cents, to: :ticket
delegate :price_currency, to: :ticket
scope :unpaid, -> { where(paid: false) }
def self.purchase(conference, user, purchases)
errors = []
ActiveRecord::Base.transaction do