diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 6565a12fe6..bb5340a0f0 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -29,7 +29,8 @@ module Ci scope :specific_for, ->(project) do # TODO: That `to_sql` is needed to workaround a weird Rails bug. # Without that, placeholders would miss one and couldn't match. - where(locked: false).where.not(id: project.runners.to_sql).specific + where(locked: false). + where.not("id IN (#{project.runners.select(:id).to_sql})").specific end validate :tag_constraints