[refactor] Clean up unused code

This commit is contained in:
Jimmy 2021-03-04 15:47:48 -08:00
parent 189c2ec75f
commit 7d70462542
2 changed files with 3 additions and 8 deletions

View file

@ -41,15 +41,15 @@ class TicketPurchasesController < ApplicationController
if @conference.registration_ticket_required? && count_registration_tickets_after == 0 if @conference.registration_ticket_required? && count_registration_tickets_after == 0
redirect_to conference_tickets_path(@conference.short_title), redirect_to conference_tickets_path(@conference.short_title),
error: 'Please get at least one registration ticket to continue.' error: 'Please get at least one registration ticket to continue.'
return return
end end
# Current user didn't have a registration ticket and is purchasing one # Current user didn't have a registration ticket and is purchasing one
if count_registration_tickets_before == 0 && count_registration_tickets_after == 1 if count_registration_tickets_before == 0 && count_registration_tickets_after == 1
redirect_to new_conference_conference_registration_path(@conference.short_title) redirect_to new_conference_conference_registration_path(@conference.short_title)
else else
redirect_to conference_physical_tickets_path redirect_to conference_physical_tickets_path
end end
end end
def index def index

View file

@ -110,11 +110,6 @@ class TicketPurchase < ApplicationRecord
errors.add(:quantity, 'cannot be greater than one for registration tickets.') errors.add(:quantity, 'cannot be greater than one for registration tickets.')
end end
end end
# def has_registration_ticket_for?(conference)
# # BUG: ticket_purchase has only one ticket?
# ticket.try(:registration_ticket?)
# end
end end
private private