summaryrefslogtreecommitdiff
path: root/lib/api/discussions.rb
diff options
context:
space:
mode:
authorDylan Griffith <dyl.griffith@gmail.com>2018-04-24 15:07:34 +1000
committerDylan Griffith <dyl.griffith@gmail.com>2018-04-24 15:07:34 +1000
commit1b9c1ac3adb3d65e51f38e37c4705d46c5618f88 (patch)
treeb724afd0596dd658f7ef7baddf9411ff3e599f7d /lib/api/discussions.rb
parent392c411bdc16386ef42c86afaf8c4d8e4cddb955 (diff)
parent2e00c1a72afc4b7388bb46bd6d58608e2ae61899 (diff)
downloadgitlab-ce-1b9c1ac3adb3d65e51f38e37c4705d46c5618f88.tar.gz
Merge branch 'master' into 10244-add-project-ci-cd-settings
Diffstat (limited to 'lib/api/discussions.rb')
-rw-r--r--lib/api/discussions.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/discussions.rb b/lib/api/discussions.rb
index 6abd575b6ad..7975f35ab1e 100644
--- a/lib/api/discussions.rb
+++ b/lib/api/discussions.rb
@@ -25,7 +25,7 @@ module API
get ":id/#{noteables_str}/:noteable_id/discussions" do
noteable = find_noteable(parent_type, noteables_str, params[:noteable_id])
- return not_found!("Discussions") unless can?(current_user, noteable_read_ability_name(noteable), noteable)
+ break not_found!("Discussions") unless can?(current_user, noteable_read_ability_name(noteable), noteable)
notes = noteable.notes
.inc_relations_for_view
@@ -50,7 +50,7 @@ module API
notes = readable_discussion_notes(noteable, params[:discussion_id])
if notes.empty? || !can?(current_user, noteable_read_ability_name(noteable), noteable)
- return not_found!("Discussion")
+ break not_found!("Discussion")
end
discussion = Discussion.build(notes, noteable)
@@ -98,7 +98,7 @@ module API
notes = readable_discussion_notes(noteable, params[:discussion_id])
if notes.empty? || !can?(current_user, noteable_read_ability_name(noteable), noteable)
- return not_found!("Notes")
+ break not_found!("Notes")
end
present notes, with: Entities::Note
@@ -117,8 +117,8 @@ module API
noteable = find_noteable(parent_type, noteables_str, params[:noteable_id])
notes = readable_discussion_notes(noteable, params[:discussion_id])
- return not_found!("Discussion") if notes.empty?
- return bad_request!("Discussion is an individual note.") unless notes.first.part_of_discussion?
+ break not_found!("Discussion") if notes.empty?
+ break bad_request!("Discussion is an individual note.") unless notes.first.part_of_discussion?
opts = {
note: params[:body],