add payment resources, controllers and method for updating purchased ticket's parameters
This commit is contained in:
parent
36f2cf4373
commit
900a1b32a8
4 changed files with 47 additions and 0 deletions
|
|
@ -53,4 +53,15 @@ class TicketPurchase < ActiveRecord::Base
|
|||
purchase.quantity = quantity if quantity > 0
|
||||
purchase
|
||||
end
|
||||
|
||||
def self.update_paid_ticket_purchases(conference, user, payment)
|
||||
paid_ticket_purchases = TicketPurchase.where(conference_id: conference.id,
|
||||
user_id: user.id,
|
||||
paid: 'f')
|
||||
begin
|
||||
paid_ticket_purchases.each do |ticket|
|
||||
ticket.update_columns(paid: 't', payment_id: payment.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue