Require code of conduct acceptance on registration

This commit is contained in:
James Mason 2018-03-16 16:23:01 -07:00 committed by Ana María Martínez Gómez
parent 95196c7f80
commit 03ef28e74d
9 changed files with 91 additions and 8 deletions

View file

@ -28,6 +28,10 @@ class Registration < ApplicationRecord
validate :registration_limit_not_exceed, on: :create
validate :registration_to_events_only_if_present
validates :accepted_code_of_conduct, acceptance: {
if: -> { conference.code_of_conduct.present? }
}
after_create :set_week, :subscribe_to_conference, :send_registration_mail
##