mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
changes for test faliures
This commit is contained in:
parent
6d67e9c959
commit
66a2777677
1 changed files with 3 additions and 3 deletions
|
|
@ -62,10 +62,10 @@ class Ticket < ApplicationRecord
|
|||
|
||||
def tickets_turnover_total(id)
|
||||
tickets = TicketPurchase.where(ticket_id: id).paid
|
||||
unless tickets. blank?
|
||||
tickets.inject(Money.new(0, tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
|
||||
else
|
||||
if tickets.blank?
|
||||
Money.new(0, Ticket.find(id).price_currency)
|
||||
else
|
||||
tickets.inject(Money.new(0, tickets.first.price_currency)){ |sum, ticket| sum + (ticket.amount_paid * ticket.quantity) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue