FIX: Add length validation for `User#name`.

This commit is contained in:
Guo Xiang Tan 2017-01-03 13:42:33 +08:00
parent 1cf0401e26
commit 980cea7081
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ class User < ActiveRecord::Base
validates :email, format: { with: EmailValidator.email_regex }, if: :email_changed? validates :email, format: { with: EmailValidator.email_regex }, if: :email_changed?
validates :email, email: true, if: :should_validate_email? validates :email, email: true, if: :should_validate_email?
validate :password_validator validate :password_validator
validates :name, user_full_name: true, if: :name_changed? validates :name, user_full_name: true, if: :name_changed?, length: { maximum: 255 }
validates :ip_address, allowed_ip_address: {on: :create, message: :signup_not_allowed} validates :ip_address, allowed_ip_address: {on: :create, message: :signup_not_allowed}
after_initialize :add_trust_level after_initialize :add_trust_level