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:
authorKamil TrzciƄski <ayufan@ayufan.eu>2018-05-23 14:55:59 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2018-05-31 11:56:07 +0300
commit8d5d6ada5ed4630edf618f468565721be842e748 (patch)
tree7dc7190fbb57d918efad2f44b321d28b966eb014 /app/services/ci
parent051f385e7e82130e6978cd3956e5c48fbdc83b2e (diff)
Fix weird Rails bug that leads to `runner_id=null` in SQL query
Diffstat (limited to 'app/services/ci')
-rw-r--r--app/services/ci/register_job_service.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb
index 9d288ca8038..28b97e3da67 100644
--- a/app/services/ci/register_job_service.rb
+++ b/app/services/ci/register_job_service.rb
@@ -90,7 +90,7 @@ module Ci
def builds_for_group_runner
# Workaround for weird Rails bug, that makes `runner.groups.to_sql` to return `runner_id = NULL`
- groups = Group.joins(:runner_namespaces).merge(runner.runner_namespaces)
+ groups = Group.joins(:runner_namespaces).where(runner_namespaces: { runner_id: runner })
hierarchy_groups = Gitlab::GroupHierarchy.new(groups).base_and_descendants
projects = Project.where(namespace_id: hierarchy_groups)
.with_group_runners_enabled