From 7808c9cb50f9706cc2ff4f75abe9531ce683f50a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kukr=C3=A1l?= Date: Thu, 11 Aug 2016 09:37:09 +0200 Subject: validate length of label.title + add test for label.title length validation --- app/models/label.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/label.rb') 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) } -- cgit v1.2.3