From db8ef92109c7785f44b26f9870af0259c504796b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sun, 29 Sep 2019 10:13:01 +0800 Subject: [PATCH] 1 --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 069a29bed..ef7eecbac 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -165,7 +165,7 @@ class User < ApplicationRecord # validates_format_of :phone, with: VALID_PHONE_REGEX, multiline: true validate :validate_password_length #validate :validate_ID_number - validates_format_of :ID_number, message: "身份证号格式不对", with: VALID_NUMBER_REGEX, multiline: true + validates_format_of :ID_number => { message: "身份证号格式不对"}, with: VALID_NUMBER_REGEX, multiline: true # validates :nickname, presence: true, length: { maximum: 10 } # validates :lastname, presence: true