From b0c8b7a60ae62742e4ad0e278149d72e8c53367f Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 16 Aug 2019 16:56:05 +0530 Subject: [PATCH] Add validation for email and coc --- app/models/booth.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/booth.rb b/app/models/booth.rb index 71ab6e98..14740745 100644 --- a/app/models/booth.rb +++ b/app/models/booth.rb @@ -25,10 +25,15 @@ class Booth < ApplicationRecord :state, :responsibles, :conference_id, + :email, :website_url, :submitter_relationship, presence: true + validates :accepted_code_of_conduct, acceptance: { + if: -> { conference.try(:code_of_conduct).present? } + } + scope :accepted, -> { where(state: 'accepted') } scope :confirmed, -> { where(state: 'confirmed') }