summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2017-10-03 18:13:13 -0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2017-10-04 00:09:48 -0300
commit1f54c9216f178e96010b28a74f04bae5848ef15d (patch)
tree7f5b63c6db133916be3cb20d94d30c0c64dc60d3 /app/presenters
parentccfe6860079c6c75ab5a1f831cd62af0e355331e (diff)
downloadgitlab-ce-1f54c9216f178e96010b28a74f04bae5848ef15d.tar.gz
Reduce method calls while evaluating Projects::MergeRequestsController#show.json36876-mr-show-json-controller-perf-improvements
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/merge_request_presenter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb
index 2df84e58575..a25882cbb62 100644
--- a/app/presenters/merge_request_presenter.rb
+++ b/app/presenters/merge_request_presenter.rb
@@ -31,7 +31,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
def remove_wip_path
- if can?(current_user, :update_merge_request, merge_request.project)
+ if work_in_progress? && can?(current_user, :update_merge_request, merge_request.project)
remove_wip_project_merge_request_path(project, merge_request)
end
end