summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-07 17:43:18 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-06-09 16:00:24 +0800
commit5bd077bd41653ead0925fd775fd07ba3fd26468f (patch)
tree8a3239d242283af2c8d40b1dc69daa1499874dcc
parentfc51bf324826799ec43c8a0b59ad94f0220df8e2 (diff)
downloadgitlab-ce-5bd077bd41653ead0925fd775fd07ba3fd26468f.tar.gz
Manually build the SQL so that it properly skips Rails.
-rw-r--r--app/models/ci/runner.rb3
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