diff --git a/app/models/issue_tag.rb b/app/models/issue_tag.rb index 0da4ca730..98e0f9072 100644 --- a/app/models/issue_tag.rb +++ b/app/models/issue_tag.rb @@ -28,6 +28,8 @@ class IssueTag < ApplicationRecord belongs_to :project, optional: true, counter_cache: true belongs_to :user, optional: true + validates :name, uniqueness: { message: "已存在" } + def self.init_data(project_id) data = [ ["缺陷", "表示存在意外问题或错误", "#d92d4c"], diff --git a/config/locales/zh-CN.yml b/config/locales/zh-CN.yml index e7c586417..b09b55f45 100644 --- a/config/locales/zh-CN.yml +++ b/config/locales/zh-CN.yml @@ -233,6 +233,8 @@ zh-CN: content: 'git忽略文件内容' feedback_message_history: title: '' + issue_tag: + name: '项目标记' close_pr: 合并请求 roles: Developer: 开发者