From 5922c8800fde43e597c8eca7d11085596f8cd738 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 17 Apr 2023 10:40:58 +0800 Subject: [PATCH] =?UTF-8?q?commit=E5=8A=A0=E5=85=A5=E5=88=B0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=8A=A8=E6=80=81=EF=BC=8C=E5=B9=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/project_trends/_detail.json.jbuilder | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/project_trends/_detail.json.jbuilder b/app/views/project_trends/_detail.json.jbuilder index 29609bd28..f8d1006dd 100644 --- a/app/views/project_trends/_detail.json.jbuilder +++ b/app/views/project_trends/_detail.json.jbuilder @@ -19,12 +19,14 @@ 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.user do - json.partial! 'users/user_simple', locals: {user: commit_log.user} + json.commit_log do + commit_log = trend.trend + json.user do + json.partial! 'users/user_simple', locals: {user: commit_log.user} + end + json.ref commit_log.ref.to_s.gsub("refs/heads/", "") + json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at end - json.ref commit_log.ref.to_s.gsub("refs/heads/", "") - json.extract! commit_log, :id,:name,:full_name,:message, :commit_id,:created_at,:updated_at else json.name trend.trend&.title json.created_at format_time(trend.trend&.created_at)