From 53f775ae6d6d0cd33a6a1421e736670b45e59309 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Fri, 29 Jan 2016 16:44:29 +0100 Subject: Fix runners filtering in API --- lib/api/runners.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/api') diff --git a/lib/api/runners.rb b/lib/api/runners.rb index b7294258c7d..799c10a1897 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -121,11 +121,11 @@ module API return runners unless scope.present? available_scopes = ::Ci::Runner::AVAILABLE_SCOPES - unless (available_scopes && scope).empty? - runners.send(scope) - else + if (available_scopes & [scope]).empty? render_api_error!('Scope contains invalid value', 400) end + + runners.send(scope) end def get_runner(id) -- cgit v1.2.1