From 9c722933baf360aca29b7764b0c93f361b2f8803 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 6 Nov 2019 16:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=9B=BE=E7=89=87=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/users/apply_authentication_form.rb | 3 ++- app/forms/users/apply_professional_auth_form.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/forms/users/apply_authentication_form.rb b/app/forms/users/apply_authentication_form.rb index e9bd1b793..a16a884c8 100644 --- a/app/forms/users/apply_authentication_form.rb +++ b/app/forms/users/apply_authentication_form.rb @@ -1,10 +1,11 @@ class Users::ApplyAuthenticationForm include ActiveModel::Model - attr_accessor :name, :id_number, :gender, :upload_image + attr_accessor :name, :id_number, :gender, :upload_image, :attachment_ids validates :name, presence: true validate :validate_ID_number + validates :attachment_ids, presence: true def validate_ID_number diff --git a/app/forms/users/apply_professional_auth_form.rb b/app/forms/users/apply_professional_auth_form.rb index c5de9700c..a8910482d 100644 --- a/app/forms/users/apply_professional_auth_form.rb +++ b/app/forms/users/apply_professional_auth_form.rb @@ -1,10 +1,11 @@ class Users::ApplyProfessionalAuthForm include ActiveModel::Model - attr_accessor :school_id, :department_id, :identity, :extra, :upload_image + attr_accessor :school_id, :department_id, :identity, :extra, :upload_image, :attachment_ids validates :school_id, presence: true, numericality: { only_integer: true, greater_than: 0 } validates :department_id, numericality: { only_integer: true, greater_than: 0 }, allow_blank: true validates :identity, presence: true, inclusion: { in: %w(student teacher professional) } validates :extra, presence: true + validates :attachment_ids, presence: true end \ No newline at end of file