You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/forms/users/apply_authentication_form.rb

16 lines
392 B

class Users::ApplyAuthenticationForm
include ActiveModel::Model
attr_accessor :name, :id_number, :upload_image
validates :name, presence: true
5 years ago
validate :validate_ID_number
def validate_ID_number
5 years ago
Rails.logger.info("##id_number: #{id_number}")
if id_number.present? && (id_number =~ User::VALID_NUMBER_REGEX).present?
5 years ago
raise("身份证格式不对")
end
end
end