tidying up

This commit is contained in:
Michael Ball 2020-07-17 20:31:48 -07:00
parent 8195426c2c
commit 61be84a7f9
2 changed files with 2 additions and 1 deletions

View file

@ -70,6 +70,7 @@ class Registration < ApplicationRecord
def user_has_registration_ticket
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
errors.add(:base, 'You must purchase a registration ticket before registering')
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
errors.add(:base, 'You currently have a ticket with an unfinished purchase')