Correct validators so that existing error messages would look correct (#3668)
This commit is contained in:
parent
1a065fb146
commit
cdff1da901
5 changed files with 23 additions and 22 deletions
|
@ -57,7 +57,8 @@ class Account < ApplicationRecord
|
|||
validates :username, uniqueness: { scope: :domain, case_sensitive: true }, if: -> { !local? && username_changed? }
|
||||
|
||||
# Local user validations
|
||||
validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, unreserved: true, if: -> { local? && username_changed? }
|
||||
validates :username, format: { with: /\A[a-z0-9_]+\z/i }, uniqueness: { scope: :domain, case_sensitive: false }, length: { maximum: 30 }, if: -> { local? && username_changed? }
|
||||
validates_with UnreservedUsernameValidator, if: -> { local? && username_changed? }
|
||||
validates :display_name, length: { maximum: 30 }, if: -> { local? && display_name_changed? }
|
||||
validates :note, length: { maximum: 160 }, if: -> { local? && note_changed? }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue