Authorize ticket purchase

This commit is contained in:
siddhantbajaj 2017-07-20 18:14:38 +05:30
parent 0528dbf8e8
commit 1c9891215d

View file

@ -2,6 +2,7 @@ class TicketPurchasesController < ApplicationController
before_filter :authenticate_user!
load_resource :conference, find_by: :short_title
authorize_resource :conference_registrations, class: Registration
authorize_resource
def create
current_user.ticket_purchases.by_conference(@conference).unpaid.destroy_all