diff --git a/app/helpers/pull_requests_helper.rb b/app/helpers/pull_requests_helper.rb index fc9e7b4c8..03c8358ab 100644 --- a/app/helpers/pull_requests_helper.rb +++ b/app/helpers/pull_requests_helper.rb @@ -14,6 +14,11 @@ module PullRequestsHelper User.find(user_id).try(:login) end + # 获取接受PullRequest用户的信息 + def accept_user pull_request_id + PullRequest.where(:pull_request_id => pull_request_id).first + end + def get_state state case state when "open","reopened" diff --git a/app/views/pull_requests/_show.html.erb b/app/views/pull_requests/_show.html.erb index 198035850..d982ffd8c 100644 --- a/app/views/pull_requests/_show.html.erb +++ b/app/views/pull_requests/_show.html.erb @@ -24,7 +24,9 @@ <% else %> <% if @request.state == "merged" %>
- <%#= link_to @request.author.try(:username), user_path(get_user_by_login_and(@request.author.try(:username))), :class => "link-blue" %>于<%= time_tag(@request.created_at) %> 前合并
+ <% unless accept_user(@request.id).blank? %> + <%= link_to User.find(accept_user(@request.id).user_id), user_path(accept_user(@request.id).user_id), :class => "link-blue" %> 于 <%= time_tag(accept_user(@request.id).created_at) %> 前合并
+ <% end %>

改动已合并至<%= @request.target_branch %>

<% else %>