add more explanatory true/false values
This commit is contained in:
parent
f202c6b93b
commit
c0c84b9dbf
4 changed files with 14 additions and 17 deletions
|
|
@ -45,7 +45,7 @@ class TicketPurchase < ActiveRecord::Base
|
|||
purchase = TicketPurchase.where(ticket_id: ticket.id,
|
||||
conference_id: conference.id,
|
||||
user_id: user.id,
|
||||
paid: 'f').first
|
||||
paid: false).first
|
||||
|
||||
purchase.quantity = quantity if quantity > 0
|
||||
purchase
|
||||
|
|
@ -54,10 +54,10 @@ class TicketPurchase < ActiveRecord::Base
|
|||
def self.update_paid_ticket_purchases(conference, user, payment)
|
||||
paid_ticket_purchases = TicketPurchase.where(conference_id: conference.id,
|
||||
user_id: user.id,
|
||||
paid: 'f')
|
||||
paid: false)
|
||||
begin
|
||||
paid_ticket_purchases.each do |ticket|
|
||||
ticket.paid = 't'
|
||||
ticket.paid = true
|
||||
ticket.payment_id = payment.id
|
||||
ticket.save
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue