Merge ac066b0546 into c97a774579
This commit is contained in:
commit
938269681d
2 changed files with 7 additions and 0 deletions
|
|
@ -83,7 +83,11 @@ class ConferenceRegistrationsController < ApplicationController
|
|||
end
|
||||
|
||||
def destroy
|
||||
tickets_purchased = TicketPurchase.where(conference_id: @registration.conference_id)
|
||||
if @registration.destroy
|
||||
if tickets_purchased
|
||||
tickets_purchased.destroy
|
||||
end
|
||||
redirect_to root_path,
|
||||
notice: "You are not registered for #{@conference.title} anymore!"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue