From 031f2769835c1e18d00f8a707ea5cb0c8f8e1e09 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 18 Apr 2023 10:08:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E6=A0=A1=E9=AA=8Csc?= =?UTF-8?q?ope=E6=96=B0=E5=A2=9Eproject=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue_tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/issue_tag.rb b/app/models/issue_tag.rb index 98e0f9072..b4ee673f7 100644 --- a/app/models/issue_tag.rb +++ b/app/models/issue_tag.rb @@ -28,7 +28,7 @@ class IssueTag < ApplicationRecord belongs_to :project, optional: true, counter_cache: true belongs_to :user, optional: true - validates :name, uniqueness: { message: "已存在" } + validates :name, uniqueness: {scope: :project_id, message: "已存在" } def self.init_data(project_id) data = [