summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorBrandon Labuschagne <blabuschagne@gitlab.com>2019-03-14 12:32:07 +0200
committerBrandon Labuschagne <blabuschagne@gitlab.com>2019-04-05 09:35:34 +0200
commitebfe19e8e7690598f86facc0bb18df4052468fc0 (patch)
tree895c9eff8dec2e7d2a93672d15a148503a6b5d4e /app
parentb54228ad3d79dc0bd7060128e0b75f68cd1c51d9 (diff)
downloadgitlab-ce-ebfe19e8e7690598f86facc0bb18df4052468fc0.tar.gz
Add limit of 128 characters to users name57493-add-limit-to-user-name
Truncate existing users names which exceed 128 characters Include test for truncating users names
Diffstat (limited to 'app')
-rw-r--r--app/models/user.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index b426d100537..259889995d3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -159,7 +159,7 @@ class User < ApplicationRecord
# Validations
#
# Note: devise :validatable above adds validations for :email and :password
- validates :name, presence: true
+ validates :name, presence: true, length: { maximum: 128 }
validates :email, confirmation: true
validates :notification_email, presence: true
validates :notification_email, devise_email: true, if: ->(user) { user.notification_email != user.email }