Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/runner.rb')
-rw-r--r--app/models/ci/runner.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 7727e94875b..6319163b0d7 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -100,7 +100,10 @@ module Ci
scope :with_recent_runner_queue, -> { where('contacted_at > ?', recent_queue_deadline) }
scope :with_running_builds, -> do
- where('EXISTS(?)', ::Ci::Build.running.select(1).where('ci_builds.runner_id = ci_runners.id'))
+ where('EXISTS(?)',
+ ::Ci::Build.running.select(1)
+ .where("#{::Ci::Build.quoted_table_name}.runner_id = #{quoted_table_name}.id")
+ )
end
# BACKWARD COMPATIBILITY: There are needed to maintain compatibility with `AVAILABLE_SCOPES` used by `lib/api/runners.rb`