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
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
Hide 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
...
@@ -28,8 +28,7 @@ class Projects::NotesController < Projects::ApplicationController
def
create
def
create
create_params
=
note_params
.
merge
(
create_params
=
note_params
.
merge
(
merge_request_diff_head_sha:
params
[
:merge_request_diff_head_sha
],
merge_request_diff_head_sha:
params
[
:merge_request_diff_head_sha
],
in_reply_to_discussion_id:
params
[
:in_reply_to_discussion_id
],
in_reply_to_discussion_id:
params
[
:in_reply_to_discussion_id
]
new_discussion:
params
[
:new_discussion
],
)
)
@note
=
Notes
::
CreateService
.
new
(
project
,
current_user
,
create_params
).
execute
@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
...
@@ -2,7 +2,6 @@ module Notes
class
BuildService
<
::
BaseService
class
BuildService
<
::
BaseService
def
execute
def
execute
in_reply_to_discussion_id
=
params
.
delete
(
:in_reply_to_discussion_id
)
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?
if
project
&&
in_reply_to_discussion_id
.
present?
discussion
=
project
.
notes
.
find_discussion
(
in_reply_to_discussion_id
)
discussion
=
project
.
notes
.
find_discussion
(
in_reply_to_discussion_id
)
...
@@ -14,9 +13,6 @@ module Notes
...
@@ -14,9 +13,6 @@ module Notes
end
end
params
.
merge!
(
discussion
.
reply_attributes
)
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
end
note
=
Note
.
new
(
params
)
note
=
Note
.
new
(
params
)
...
...
spec/controllers/projects/notes_controller_spec.rb
View file @
09330dd1
...
@@ -153,8 +153,7 @@ describe Projects::NotesController do
...
@@ -153,8 +153,7 @@ describe Projects::NotesController do
noteable_id:
merge_request
.
id
.
to_s
,
noteable_id:
merge_request
.
id
.
to_s
,
noteable_type:
'MergeRequest'
,
noteable_type:
'MergeRequest'
,
merge_request_diff_head_sha:
'sha'
,
merge_request_diff_head_sha:
'sha'
,
in_reply_to_discussion_id:
nil
,
in_reply_to_discussion_id:
nil
new_discussion:
nil
}
}
expect
(
Notes
::
CreateService
).
to
receive
(
:new
).
with
(
project
,
user
,
service_params
).
and_return
(
double
(
execute:
true
))
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