summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-02-07 15:30:41 -0200
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-02-07 16:29:28 -0200
commitfd372ce3957dd810c9f774944d68aaed6fd46d98 (patch)
tree61964edd17197903ae699afd23ad2a86246425fe /app
parentdfe9f0bc6ed38363c7e6c01bf95b42f3e5c0166b (diff)
downloadgitlab-ce-fd372ce3957dd810c9f774944d68aaed6fd46d98.tar.gz
Address naming suggestion
Diffstat (limited to 'app')
-rw-r--r--app/presenters/merge_request_presenter.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb
index c1b4429bd0c..08ae49562c7 100644
--- a/app/presenters/merge_request_presenter.rb
+++ b/app/presenters/merge_request_presenter.rb
@@ -44,7 +44,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
def revert_in_fork_path
- if user_can_fork_project? && _can_be_reverted?
+ if user_can_fork_project? && cached_can_be_reverted?
continue_params = {
to: merge_request_path(merge_request),
notice: "#{edit_in_new_fork_notice} Try to cherry-pick this commit again.",
@@ -152,7 +152,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
end
def can_revert_on_current_merge_request?
- user_can_collaborate_with_project? && _can_be_reverted?
+ user_can_collaborate_with_project? && cached_can_be_reverted?
end
def can_cherry_pick_on_current_merge_request?
@@ -165,8 +165,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated
private
- # Method overrides doesn't work for Gitlab::View::Presenter::Delegated
- def _can_be_reverted?
+ def cached_can_be_reverted?
strong_memoize(:can_be_reverted) do
can_be_reverted?(current_user)
end