From 6d440063ba143f7cadac364af8b31a6e90651583 Mon Sep 17 00:00:00 2001 From: ViditChitkara Date: Sat, 23 Dec 2017 18:41:10 +0530 Subject: [PATCH] minor changes --- app/models/ticket.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/ticket.rb b/app/models/ticket.rb index d9723a2b..19f2f2f4 100644 --- a/app/models/ticket.rb +++ b/app/models/ticket.rb @@ -62,7 +62,7 @@ class Ticket < ApplicationRecord def tickets_turnover_total(id) tickets = TicketPurchase.where(ticket_id: id).paid - if tickets.nil? + unless tickets. blank? 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)