Prevent math errors in calculating ticket 'turnover'

This commit is contained in:
James Mason 2018-10-08 08:52:58 -07:00
parent d0f673b73d
commit 3031bb43cf
No known key found for this signature in database
GPG key ID: 1B3951886C449023
5 changed files with 7 additions and 13 deletions

View file

@ -71,11 +71,6 @@ class TicketPurchase < ApplicationRecord
purchase
end
# Total amount
def self.total
sum('amount_paid * quantity')
end
def pay(payment)
update_attributes(paid: true, payment: payment)
PhysicalTicket.transaction do