diff options
author | Rémy Coutable <remy@rymai.me> | 2017-01-09 20:50:57 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-01-09 20:50:57 +0000 |
commit | 6524ec5deead306773e34a11152cb87e613a9273 (patch) | |
tree | 2b3d7e24b0b17f5ca18b8f62b9602f51f696ae14 /app/models | |
parent | 83fd7ea533e8c3b5815ac9cdc4753b3120b32b75 (diff) | |
parent | 7808c9cb50f9706cc2ff4f75abe9531ce683f50a (diff) | |
download | gitlab-ce-6524ec5deead306773e34a11152cb87e613a9273.tar.gz |
Merge branch 'label-length-validation' into 'master'
Validate label's title length
See merge request !5767
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/label.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 5c01c15e5af..5b6b9a7a736 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -26,6 +26,7 @@ class Label < ActiveRecord::Base # Don't allow ',' for label titles validates :title, presence: true, format: { with: /\A[^,]+\z/ } validates :title, uniqueness: { scope: [:group_id, :project_id] } + validates :title, length: { maximum: 255 } default_scope { order(title: :asc) } |