From 827e265fc51edef8ef6c08b0d213f09cbb8c5a01 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 18 Apr 2023 09:56:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8F=90=E4=BA=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/project_trends/_detail.json.jbuilder | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/project_trends/_detail.json.jbuilder b/app/views/project_trends/_detail.json.jbuilder index f8d1006d..e7c590b8 100644 --- a/app/views/project_trends/_detail.json.jbuilder +++ b/app/views/project_trends/_detail.json.jbuilder @@ -19,8 +19,10 @@ if trend.trend_type == "Issue" elsif trend.trend_type == "VersionRelease" json.partial! "version_releases/simple_version_release", locals: {version: trend.trend} elsif trend.trend_type == "CommitLog" + commit_log = trend.trend + json.name commit_log.message + json.created_at format_time(commit_log.created_at) json.commit_log do - commit_log = trend.trend json.user do json.partial! 'users/user_simple', locals: {user: commit_log.user} end From 031f2769835c1e18d00f8a707ea5cb0c8f8e1e09 Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 18 Apr 2023 10:08:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8Cscope=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 98e0f907..b4ee673f 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 = [