新增:项目标记已存在validate

This commit is contained in:
2023-04-18 09:44:34 +08:00
parent 578acd7845
commit f078c59cf4
2 changed files with 4 additions and 0 deletions

View File

@@ -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"],