Commit a794b161 authored by Micaël Bergeron's avatar Micaël Bergeron

rework the merge_request_version_params to use Object#tap

parent c77083a4
...@@ -23,9 +23,8 @@ class DiffDiscussion < Discussion ...@@ -23,9 +23,8 @@ class DiffDiscussion < Discussion
def merge_request_version_params def merge_request_version_params
return unless for_merge_request? 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[:commit_id] = commit_id if on_merge_request_commit?
params
end end
end end
...@@ -39,11 +38,8 @@ class DiffDiscussion < Discussion ...@@ -39,11 +38,8 @@ class DiffDiscussion < Discussion
private private
def version_params def version_params
params = if active? return {} if active?
{}
else noteable.version_params_for(position.diff_refs)
noteable.version_params_for(position.diff_refs)
end
yield params
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment