Merge pull request #1118 from rishabhs95/free-ticket

ability to create and purchase free tickets
This commit is contained in:
Hernán Schmidt 2017-01-31 14:54:18 +01:00 committed by GitHub
commit a4ef10cf1b
9 changed files with 88 additions and 24 deletions

View file

@ -10,6 +10,9 @@ class TicketPurchasesController < ApplicationController
if current_user.ticket_purchases.by_conference(@conference).unpaid.any?
redirect_to new_conference_payment_path,
notice: 'Please pay here to get tickets.'
elsif current_user.ticket_purchases.by_conference(@conference).paid.any?
redirect_to conference_conference_registration_path(@conference.short_title),
notice: 'You have free tickets for the conference.'
else
redirect_to conference_tickets_path(@conference.short_title),
error: 'Please get at least one ticket to continue.'