diff --git a/app/models/user.rb b/app/models/user.rb index d148d5655..d74ea1b09 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -166,7 +166,7 @@ class User < ApplicationRecord validate :validate_password_length #validate :validate_ID_number #validates_format_of :ID_number, with: VALID_NUMBER_REGEX, multiline: true, message: "身份证号格式不对" - validates :ID_number, format: {with: VALID_NUMBER_REGEX}, message: "身份证格式不对" + validates :ID_number, format: {with: VALID_NUMBER_REGEX, multiline: true, message: "身份证格式不对"} # validates :nickname, presence: true, length: { maximum: 10 } # validates :lastname, presence: true