This commit is contained in:
Jimmy 2021-03-04 11:33:27 -08:00
parent 8c230352f9
commit c1fe73df03
3 changed files with 38 additions and 14 deletions

View file

@ -346,6 +346,20 @@ 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
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
end
end
end
return seen_registration
end
def self.empty?
User.count == 1 && User.first.email == 'deleted@localhost.osem'
end