diff options
-rw-r--r-- | app/models/ci/runner.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 6565a12fe62..bb5340a0f03 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 |