tidying up
This commit is contained in:
parent
8195426c2c
commit
61be84a7f9
2 changed files with 2 additions and 1 deletions
|
|
@ -70,6 +70,7 @@ class Registration < ApplicationRecord
|
||||||
|
|
||||||
def user_has_registration_ticket
|
def user_has_registration_ticket
|
||||||
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
|
return if TicketPurchase.where(user: user, ticket: conference.registration_tickets).paid.any?
|
||||||
|
|
||||||
errors.add(:base, 'You must purchase a registration ticket before registering')
|
errors.add(:base, 'You must purchase a registration ticket before registering')
|
||||||
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
|
if TicketPurchase.where(user: user, ticket: conference.registration_tickets).unpaid.any?
|
||||||
errors.add(:base, 'You currently have a ticket with an unfinished purchase')
|
errors.add(:base, 'You currently have a ticket with an unfinished purchase')
|
||||||
|
|
|
||||||
|
|
@ -407,7 +407,7 @@ ActiveRecord::Schema.define(version: 2020_07_16_181602) do
|
||||||
t.string "name", null: false
|
t.string "name", null: false
|
||||||
t.integer "size"
|
t.integer "size"
|
||||||
t.integer "venue_id", null: false
|
t.integer "venue_id", null: false
|
||||||
t.text "url"
|
t.string "url"
|
||||||
t.integer "order"
|
t.integer "order"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue