Merge pull request #1807 from ViditChitkara/ticket_turnover

fixed tickets turnover bug
This commit is contained in:
James Mason 2017-11-21 17:31:41 -08:00 committed by GitHub
commit 8442eb813f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,7 +61,7 @@ class Ticket < ActiveRecord::Base
end
def tickets_turnover_total(id)
tickets = TicketPurchase.where(ticket_id: id)
tickets = TicketPurchase.where(ticket_id: id).paid
tickets.inject(0){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
end