From a6f7516eaee64774f0b8d7c77d73baea0dde8e57 Mon Sep 17 00:00:00 2001 From: Rishabh Saxena Date: Mon, 22 Aug 2016 13:09:02 +0530 Subject: [PATCH] controller/ticket_purchase: rubocop fix --- app/controllers/ticket_purchases_controller.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/ticket_purchases_controller.rb b/app/controllers/ticket_purchases_controller.rb index a1bf8826..1c672d69 100644 --- a/app/controllers/ticket_purchases_controller.rb +++ b/app/controllers/ticket_purchases_controller.rb @@ -10,14 +10,12 @@ 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 - if 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.' - end + redirect_to conference_tickets_path(@conference.short_title), + error: 'Please get at least one ticket to continue.' end else redirect_to conference_conference_registration_path(@conference.short_title),