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
Tatuya Kamada
gitlab-ce
Commits
09330dd1
Commit
09330dd1
authored
Apr 05, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code
parent
00855926
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
8 deletions
+2
-8
app/controllers/projects/notes_controller.rb
app/controllers/projects/notes_controller.rb
+1
-2
app/services/notes/build_service.rb
app/services/notes/build_service.rb
+0
-4
spec/controllers/projects/notes_controller_spec.rb
spec/controllers/projects/notes_controller_spec.rb
+1
-2
No files found.
app/controllers/projects/notes_controller.rb
View file @
09330dd1
...
...
@@ -28,8 +28,7 @@ class Projects::NotesController < Projects::ApplicationController
def
create
create_params
=
note_params
.
merge
(
merge_request_diff_head_sha:
params
[
:merge_request_diff_head_sha
],
in_reply_to_discussion_id:
params
[
:in_reply_to_discussion_id
],
new_discussion:
params
[
:new_discussion
],
in_reply_to_discussion_id:
params
[
:in_reply_to_discussion_id
]
)
@note
=
Notes
::
CreateService
.
new
(
project
,
current_user
,
create_params
).
execute
...
...
app/services/notes/build_service.rb
View file @
09330dd1
...
...
@@ -2,7 +2,6 @@ module Notes
class
BuildService
<
::
BaseService
def
execute
in_reply_to_discussion_id
=
params
.
delete
(
:in_reply_to_discussion_id
)
new_discussion
=
params
.
delete
(
:new_discussion
)
if
project
&&
in_reply_to_discussion_id
.
present?
discussion
=
project
.
notes
.
find_discussion
(
in_reply_to_discussion_id
)
...
...
@@ -14,9 +13,6 @@ module Notes
end
params
.
merge!
(
discussion
.
reply_attributes
)
elsif
new_discussion
# TODO: Remove when we use a selectbox instead of a submit button
params
[
:type
]
=
DiscussionNote
.
name
end
note
=
Note
.
new
(
params
)
...
...
spec/controllers/projects/notes_controller_spec.rb
View file @
09330dd1
...
...
@@ -153,8 +153,7 @@ describe Projects::NotesController do
noteable_id:
merge_request
.
id
.
to_s
,
noteable_type:
'MergeRequest'
,
merge_request_diff_head_sha:
'sha'
,
in_reply_to_discussion_id:
nil
,
new_discussion:
nil
in_reply_to_discussion_id:
nil
}
expect
(
Notes
::
CreateService
).
to
receive
(
:new
).
with
(
project
,
user
,
service_params
).
and_return
(
double
(
execute:
true
))
...
...
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