Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
a794b161
Commit
a794b161
authored
Dec 18, 2017
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rework the merge_request_version_params to use Object#tap
parent
c77083a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
app/models/diff_discussion.rb
app/models/diff_discussion.rb
+4
-8
No files found.
app/models/diff_discussion.rb
View file @
a794b161
...
@@ -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
end
yield
params
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment