summaryrefslogtreecommitdiff
path: root/lib/api/triggers.rb
diff options
context:
space:
mode:
author🙈 jacopo beschi 🙉 <intrip@gmail.com>2018-04-18 09:19:40 +0000
committerRémy Coutable <remy@rymai.me>2018-04-18 09:19:40 +0000
commitc6b1043e9d1b7fe9912c330b6e7d4342f2a9694e (patch)
tree45c3fd39c83122eb602f217501924bc8d6899987 /lib/api/triggers.rb
parent3529ccae9e3a484da5a4fba32bfdf0317f289363 (diff)
downloadgitlab-ce-c6b1043e9d1b7fe9912c330b6e7d4342f2a9694e.tar.gz
Resolve "Make a Rubocop that forbids returning from a block"
Diffstat (limited to 'lib/api/triggers.rb')
-rw-r--r--lib/api/triggers.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb
index b3709455bc3..b29e660c6e0 100644
--- a/lib/api/triggers.rb
+++ b/lib/api/triggers.rb
@@ -62,7 +62,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
present trigger, with: Entities::Trigger
end
@@ -99,7 +99,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
if trigger.update(declared_params(include_missing: false))
present trigger, with: Entities::Trigger
@@ -119,7 +119,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
if trigger.update(owner: current_user)
status :ok
@@ -140,7 +140,7 @@ module API
authorize! :admin_build, user_project
trigger = user_project.triggers.find(params.delete(:trigger_id))
- return not_found!('Trigger') unless trigger
+ break not_found!('Trigger') unless trigger
destroy_conditionally!(trigger)
end