From ca574ae2afa4f16b86cd958c336ceaec112eec6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=20Mar=C3=ADa=20Mart=C3=ADnez=20G=C3=B3mez?= Date: Wed, 27 Mar 2019 10:19:01 +0100 Subject: [PATCH] Fix failing validation in Registration In the conference is not set, validation that the call for paper is accepted breaks. This made the conference association test failing. --- app/models/registration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/registration.rb b/app/models/registration.rb index f7c032ea..bc1fbd8a 100644 --- a/app/models/registration.rb +++ b/app/models/registration.rb @@ -31,7 +31,7 @@ class Registration < ApplicationRecord validate :registration_to_events_only_if_present validates :accepted_code_of_conduct, acceptance: { - if: -> { conference.code_of_conduct.present? } + if: -> { conference.try(:code_of_conduct).present? } } after_create :set_week, :subscribe_to_conference, :send_registration_mail