From 9f9cec34b6bddc6b6d528478f5f667b0e1a406b0 Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 3 Jun 2020 11:20:11 +0800 Subject: [PATCH] FIX coder review forr branches view --- app/views/projects/branches.json.jbuilder | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/app/views/projects/branches.json.jbuilder b/app/views/projects/branches.json.jbuilder index 58f7af98f..d6f451373 100644 --- a/app/views/projects/branches.json.jbuilder +++ b/app/views/projects/branches.json.jbuilder @@ -7,19 +7,11 @@ json.array! @branches do |branch| json.zip_url render_zip_url(@project, branch['name']) json.tar_url render_tar_url(@project, branch['name']) json.last_commit do - json.id branch['commit']['id'] + json.sha branch['commit']['id'] json.message branch['commit']['message'] json.timestamp render_unix_time(branch['commit']['timestamp']) json.time_from_now time_from_now(branch['commit']['timestamp']) - end - - user = find_user_by_login_or_mail(branch['commit']['author']['name']) - json.author do - if user - json.login user.login - json.image_url url_to_avatar(user) - else - json.nil! - end + json.author branch['commit']['author'] + json.committer branch['commit']['committer'] end end