Skip to content
代码片段 群组 项目
提交 c9eaa46c 编辑于 作者: Robert Schilling's avatar Robert Schilling
浏览文件

Labels need to be valid on name

上级 a3c969cd
No related branches found
No related tags found
无相关合并请求
...@@ -9,7 +9,10 @@ class Label < ActiveRecord::Base ...@@ -9,7 +9,10 @@ class Label < ActiveRecord::Base
validates :project, presence: true validates :project, presence: true
# Don't allow '?', '&', and ',' for label titles # Don't allow '?', '&', and ',' for label titles
validates :title, presence: true, format: { with: /\A[^&\?,&]*\z/ } validates :title,
presence: true,
format: { with: /\A[^&\?,&]*\z/ },
uniqueness: true
scope :order_by_name, -> { reorder("labels.title ASC") } scope :order_by_name, -> { reorder("labels.title ASC") }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册