From 892c15b64a8edf484ec19be9247d95772a6aa173 Mon Sep 17 00:00:00 2001 From: Rishabh Saxena Date: Thu, 10 Mar 2016 03:17:28 +0530 Subject: [PATCH] destroying purchased tickets. --- app/controllers/conference_registrations_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index c9d7d216..007b9b74 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -85,7 +85,9 @@ class ConferenceRegistrationsController < ApplicationController end def destroy + tickets_purchased = TicketPurchase.find_by(conference_id: @registration.conference_id) if @registration.destroy + ticket_purchase.destroy redirect_to root_path, notice: "You are not registered for #{@conference.title} anymore!" else