Commit 5bd077bd authored by Lin Jen-Shin's avatar Lin Jen-Shin

Manually build the SQL so that it properly skips Rails.

parent fc51bf32
...@@ -29,7 +29,8 @@ module Ci ...@@ -29,7 +29,8 @@ module Ci
scope :specific_for, ->(project) do scope :specific_for, ->(project) do
# TODO: That `to_sql` is needed to workaround a weird Rails bug. # TODO: That `to_sql` is needed to workaround a weird Rails bug.
# Without that, placeholders would miss one and couldn't match. # 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 end
validate :tag_constraints validate :tag_constraints
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment