[style] Rubocop

This commit is contained in:
Jimmy 2021-03-04 16:34:47 -08:00
parent a599980046
commit 1ca58961c1
2 changed files with 10 additions and 10 deletions

View file

@ -16,7 +16,7 @@ class TicketPurchasesController < ApplicationController
count_registration_tickets_after = current_user.count_registration_tickets(@conference) count_registration_tickets_after = current_user.count_registration_tickets(@conference)
# Failed to create ticket purchase # Failed to create ticket purchase
if !message.blank? unless message.blank?
redirect_to conference_tickets_path(@conference.short_title), redirect_to conference_tickets_path(@conference.short_title),
error: "Oops, something went wrong with your purchase! #{message}" error: "Oops, something went wrong with your purchase! #{message}"
return return

View file

@ -348,15 +348,15 @@ class User < ApplicationRecord
def count_registration_tickets(conference) def count_registration_tickets(conference)
count = 0 count = 0
for ticket_purchase in ticket_purchases.by_conference(conference) ticket_purchases.by_conference(conference).each do |ticket_purchase|
for physical_ticket in ticket_purchase.physical_tickets ticket_purchase.physical_tickets.each do |physical_ticket|
if physical_ticket.ticket.registration_ticket if physical_ticket.ticket.registration_ticket
count += 1 count += 1
end end
end end
end end
return count count
end end
def self.empty? def self.empty?