Commit 2fc4cd6d authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Use EXISTS in a new query; do not disable cop

parent 361914a6
...@@ -40,7 +40,7 @@ module EE ...@@ -40,7 +40,7 @@ module EE
visibility_relation = ::Ci::Build.where( visibility_relation = ::Ci::Build.where(
projects: { visibility_level: runner.visibility_levels_without_minutes_quota }) projects: { visibility_level: runner.visibility_levels_without_minutes_quota })
enforce_limits_relation = ::Ci::Build.where("(#{builds_check_limit.to_sql})=1") # rubocop:disable GitlabSecurity/SqlInjection enforce_limits_relation = ::Ci::Build.where('EXISTS (?)', builds_check_limit)
relation.merge(visibility_relation.or(enforce_limits_relation)) relation.merge(visibility_relation.or(enforce_limits_relation))
end end
......
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