Fix weird Rails bug that leads to `runner_id=null` in SQL query
This commit is contained in:
parent
0a2f5065f2
commit
5c34c3fcd5
|
@ -89,7 +89,9 @@ module Ci
|
|||
end
|
||||
|
||||
def builds_for_group_runner
|
||||
hierarchy_groups = Gitlab::GroupHierarchy.new(runner.groups).base_and_descendants
|
||||
# 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)
|
||||
hierarchy_groups = Gitlab::GroupHierarchy.new(groups).base_and_descendants
|
||||
projects = Project.where(namespace_id: hierarchy_groups)
|
||||
.with_group_runners_enabled
|
||||
.with_builds_enabled
|
||||
|
|
Loading…
Reference in New Issue