delete unused methods, add feature tests
This commit is contained in:
parent
3b4c7d70c0
commit
223a0eead9
7 changed files with 165 additions and 47 deletions
|
|
@ -22,8 +22,7 @@ class Ticket < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def quantity_bought_by(user, paid: false)
|
||||
purchased_tickets = ticket_purchases.paid.by_user(user)
|
||||
quantity = purchased_tickets.sum(:quantity)
|
||||
ticket_purchases.by_user(user).where(paid: paid).sum(:quantity)
|
||||
end
|
||||
|
||||
def unpaid?(user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue