[refactor] Clean up unused code
This commit is contained in:
parent
189c2ec75f
commit
7d70462542
2 changed files with 3 additions and 8 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue