From 705d210c737c53aa5df6a5ee21251c14db332208 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Mon, 3 Oct 2016 18:33:43 +0800 Subject: [PATCH] Style/EmptyLinesAroundBlockBody --- app/models/commit_status.rb | 3 +++ 1 file changed, 3 insertions(+) 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) }