diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 14:16:34 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 14:16:34 +0000 |
commit | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (patch) | |
tree | 2b256ff8dfe63dafe7f42b0d995f9e74fd1dc48b /app/models/ci/build.rb | |
parent | bd860c22f6a4b9473cbddd34a53eead8235a7ea1 (diff) | |
download | gitlab-ce-4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/ci/build.rb')
-rw-r--r-- | app/models/ci/build.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 71c4501f57b..2393540b04c 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -88,7 +88,11 @@ module Ci validates :coverage, numericality: true, allow_blank: true validates :ref, presence: true - scope :not_interruptible, -> { joins(:metadata).where(ci_builds_metadata: { interruptible: false }) } + scope :not_interruptible, -> do + joins(:metadata).where('ci_builds_metadata.id NOT IN (?)', + Ci::BuildMetadata.scoped_build.with_interruptible.select(:id)) + end + scope :unstarted, ->() { where(runner_id: nil) } scope :ignore_failures, ->() { where(allow_failure: false) } scope :with_artifacts_archive, ->() do |