Delete Purchased tickets

fixes #821
This commit is contained in:
Chashmeet Singh 2016-03-05 22:26:50 +05:30
parent ac7149fbe5
commit b9614a8212

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.destory
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