[fix] Fix user.count_registration_tickets
This commit is contained in:
parent
b72dfdabf8
commit
189c2ec75f
2 changed files with 1 additions and 2 deletions
|
|
@ -47,7 +47,6 @@ class TicketPurchasesController < ApplicationController
|
|||
# Current user didn't have a registration ticket and is purchasing one
|
||||
if count_registration_tickets_before == 0 && count_registration_tickets_after == 1
|
||||
redirect_to new_conference_conference_registration_path(@conference.short_title)
|
||||
|
||||
else
|
||||
redirect_to conference_physical_tickets_path
|
||||
end
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ class User < ApplicationRecord
|
|||
|
||||
def count_registration_tickets(conference)
|
||||
count = 0
|
||||
for ticket_purchase in current_user.ticket_purchases.by_conference(@conference)
|
||||
for ticket_purchase in ticket_purchases.by_conference(conference)
|
||||
for physical_ticket in ticket_purchase.physical_tickets
|
||||
if physical_ticket.ticket.registration_ticket
|
||||
count += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue