correcting ticket's details view and its related models.
This commit is contained in:
parent
835236ed7f
commit
99afc456cd
4 changed files with 20 additions and 8 deletions
|
|
@ -48,6 +48,14 @@ class Ticket < ActiveRecord::Base
|
|||
result ? result : Money.new(0, 'USD')
|
||||
end
|
||||
|
||||
def tickets_sold
|
||||
ticket_purchases.sum(:quantity)
|
||||
end
|
||||
|
||||
def tickets_turnover
|
||||
tickets_sold * price
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def tickets_of_conference_have_same_currency
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue