Require code of conduct acceptance on registration

This commit is contained in:
James Mason 2018-03-16 16:23:01 -07:00
parent 511d5c2ed0
commit 03a2b6a3b8
No known key found for this signature in database
GPG key ID: 1B3951886C449023
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
##