From ac066b0546f4b3549ce60345b0330eed01b83c87 Mon Sep 17 00:00:00 2001 From: Rishabh Saxena Date: Fri, 11 Mar 2016 14:59:44 +0530 Subject: [PATCH] deleting all associated tickets to a user --- app/controllers/conference_registrations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index 34a1effd..fd4a2938 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -85,7 +85,7 @@ class ConferenceRegistrationsController < ApplicationController end def destroy - tickets_purchased = TicketPurchase.find_by(conference_id: @registration.conference_id) + tickets_purchased = TicketPurchase.where(conference_id: @registration.conference_id) if @registration.destroy if tickets_purchased tickets_purchased.destroy