summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMicaël Bergeron <mbergeron@gitlab.com>2017-12-18 12:02:45 -0500
committerMicaël Bergeron <mbergeron@gitlab.com>2017-12-18 12:02:45 -0500
commita794b161cd996f3328c0b9a60d0e3cbdaee2a914 (patch)
tree2aa6c7dfe867229803bfa00ee4d697e7ce2fbe3a /app
parentc77083a4938b42e1901a4cb69106a39a04f5c30d (diff)
downloadgitlab-ce-a794b161cd996f3328c0b9a60d0e3cbdaee2a914.tar.gz
rework the merge_request_version_params to use Object#tapcommit-diff-discussion-in-mr-context-fix-links
Diffstat (limited to 'app')
-rw-r--r--app/models/diff_discussion.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/app/models/diff_discussion.rb b/app/models/diff_discussion.rb
index 758a26d3c70..d67b16584a4 100644
--- a/app/models/diff_discussion.rb
+++ b/app/models/diff_discussion.rb
@@ -23,9 +23,8 @@ class DiffDiscussion < Discussion
def merge_request_version_params
return unless for_merge_request?
- version_params do |params|
+ version_params.tap do |params|
params[:commit_id] = commit_id if on_merge_request_commit?
- params
end
end
@@ -39,11 +38,8 @@ class DiffDiscussion < Discussion
private
def version_params
- params = if active?
- {}
- else
- noteable.version_params_for(position.diff_refs)
- end
- yield params
+ return {} if active?
+
+ noteable.version_params_for(position.diff_refs)
end
end