Commit 705d210c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Style/EmptyLinesAroundBlockBody

parent 23e0a3ee
...@@ -24,9 +24,11 @@ class CommitStatus < ActiveRecord::Base ...@@ -24,9 +24,11 @@ class CommitStatus < ActiveRecord::Base
scope :retried, -> { where.not(id: latest) } scope :retried, -> { where.not(id: latest) }
scope :ordered, -> { order(:name) } scope :ordered, -> { order(:name) }
scope :failed_but_allowed, -> do scope :failed_but_allowed, -> do
where(allow_failure: true, status: [:failed, :canceled]) where(allow_failure: true, status: [:failed, :canceled])
end end
scope :exclude_ignored, -> do scope :exclude_ignored, -> do
quoted_when = connection.quote_column_name('when') quoted_when = connection.quote_column_name('when')
# We want to ignore failed_but_allowed jobs # We want to ignore failed_but_allowed jobs
...@@ -38,6 +40,7 @@ class CommitStatus < ActiveRecord::Base ...@@ -38,6 +40,7 @@ class CommitStatus < ActiveRecord::Base
where("#{quoted_when} <> ? OR status <> ?", 'on_failure', 'skipped') where("#{quoted_when} <> ? OR status <> ?", 'on_failure', 'skipped')
end end
scope :latest_ci_stages, -> { latest.ordered.includes(project: :namespace) } scope :latest_ci_stages, -> { latest.ordered.includes(project: :namespace) }
scope :retried_ci_stages, -> { retried.ordered.includes(project: :namespace) } scope :retried_ci_stages, -> { retried.ordered.includes(project: :namespace) }
......
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