Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-08-05 11:12:28 +0300
committerSean McGivern <sean@gitlab.com>2019-08-05 11:12:28 +0300
commit523e00abd74a9067fb17129faa1d35bfa107e04a (patch)
tree20facb4c4149281b8d73459497a5189b483cacd5 /app/models
parent5e20689d890598a6f1539a43365659cade13cdae (diff)
parenta2bbf7b8c197922067d1266249197e5f60e0fd7f (diff)
Merge branch 'properly-process-all-needs' into 'master'
Properly process all needs Closes #65488 See merge request gitlab-org/gitlab-ce!31415
Diffstat (limited to 'app/models')
-rw-r--r--app/models/commit_status.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index d7eb78db5b8..a9c29fb390b 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -49,6 +49,10 @@ class CommitStatus < ApplicationRecord
where('EXISTS (?)', needs).preload(:needs)
end
+ scope :without_needs, -> do
+ where('NOT EXISTS (?)', Ci::BuildNeed.scoped_build.select(1))
+ end
+
# We use `CommitStatusEnums.failure_reasons` here so that EE can more easily
# extend this `Hash` with new values.
enum_with_nil failure_reason: ::CommitStatusEnums.failure_reasons