diff --git a/Gemfile.lock b/Gemfile.lock index 489ea72c..1a5b55c4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -526,8 +526,8 @@ GEM rubyzip (~> 1.2, >= 1.2.2) sexp_processor (4.11.0) shellany (0.0.1) - shoulda-matchers (3.1.2) - activesupport (>= 4.0.0) + shoulda-matchers (4.0.1) + activesupport (>= 4.2.0) simplecov (0.16.1) docile (~> 1.1) json (>= 1.8, < 3) diff --git a/app/models/registration.rb b/app/models/registration.rb index a071af28..84a9aba0 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