destroying purchased tickets.

This commit is contained in:
Rishabh Saxena 2016-03-10 03:17:28 +05:30
parent b18e302224
commit 892c15b64a

View file

@ -85,7 +85,9 @@ class ConferenceRegistrationsController < ApplicationController
end end
def destroy def destroy
tickets_purchased = TicketPurchase.find_by(conference_id: @registration.conference_id)
if @registration.destroy if @registration.destroy
ticket_purchase.destroy
redirect_to root_path, redirect_to root_path,
notice: "You are not registered for #{@conference.title} anymore!" notice: "You are not registered for #{@conference.title} anymore!"
else else