conditions completed

This commit is contained in:
rajavi-mishra 2021-03-04 11:55:45 -08:00
parent 7e37b52e20
commit b72dfdabf8
2 changed files with 23 additions and 47 deletions

View file

@ -346,18 +346,17 @@ class User < ApplicationRecord
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
end
def has_registration_ticket_for?(conference)
seen_registration = false
def count_registration_tickets(conference)
count = 0
for ticket_purchase in current_user.ticket_purchases.by_conference(@conference)
for physical_ticket in ticket_purchase.physical_tickets
if physical_ticket.ticket.registration_ticket
seen_registration = true
break
count += 1
end
end
end
return seen_registration
return count
end
def self.empty?