mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
fixed failing tests
This commit is contained in:
parent
86cab52f52
commit
0ec937e43e
2 changed files with 6 additions and 2 deletions
|
|
@ -62,7 +62,11 @@ class Ticket < ApplicationRecord
|
|||
|
||||
def tickets_turnover_total(id)
|
||||
tickets = TicketPurchase.where(ticket_id: id).paid
|
||||
tickets.inject(Money.new(0,tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
|
||||
if tickets.nil?
|
||||
tickets.inject(Money.new(0, tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
|
||||
else
|
||||
Money.new(0, Ticket.find(id).price_currency)
|
||||
end
|
||||
end
|
||||
|
||||
def tickets_sold
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue