improve flash error collection

improve views
This commit is contained in:
Rishabh Saxena 2016-08-11 17:47:52 +05:30
parent 6bd2e5e335
commit 261d7dd0de
4 changed files with 15 additions and 19 deletions

View file

@ -4,7 +4,7 @@ class TicketPurchasesController < ApplicationController
authorize_resource :conference_registrations, class: Registration
def create
TicketPurchase.by_conference(@conference).unpaid.by_user(current_user).destroy_all
current_user.ticket_purchases.by_conference(@conference).unpaid.destroy_all
message = TicketPurchase.purchase(@conference, current_user, params[:tickets][0])
if message.blank?
if current_user.ticket_purchases.by_conference(@conference).unpaid.any?