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