summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-03 18:33:43 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-03 18:33:43 +0800
commit705d210c737c53aa5df6a5ee21251c14db332208 (patch)
treed04afff0b22cab74e0653c2ce6a6fb249e7fe359
parent23e0a3ee7d3e050c6c6beb8fafa178779e7e4fc8 (diff)
downloadgitlab-ce-705d210c737c53aa5df6a5ee21251c14db332208.tar.gz
Style/EmptyLinesAroundBlockBody
-rw-r--r--app/models/commit_status.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index 0cf8d32453e..0ed87922177 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -24,9 +24,11 @@ class CommitStatus < ActiveRecord::Base
scope :retried, -> { where.not(id: latest) }
scope :ordered, -> { order(:name) }
+
scope :failed_but_allowed, -> do
where(allow_failure: true, status: [:failed, :canceled])
end
+
scope :exclude_ignored, -> do
quoted_when = connection.quote_column_name('when')
# We want to ignore failed_but_allowed jobs
@@ -38,6 +40,7 @@ class CommitStatus < ActiveRecord::Base
where("#{quoted_when} <> ? OR status <> ?", 'on_failure', 'skipped')
end
+
scope :latest_ci_stages, -> { latest.ordered.includes(project: :namespace) }
scope :retried_ci_stages, -> { retried.ordered.includes(project: :namespace) }