summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 14:20:27 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-14 17:28:38 +0200
commit4d69c6a3361bbc673e853995e3896d31241aa748 (patch)
tree95e0da6e1fbfd400f8e1d27526ee11e7f3c2da6c /app/models/commit_status.rb
parent09255eecd0812d35b09613a1cf2402d3108fcc49 (diff)
downloadgitlab-ce-4d69c6a3361bbc673e853995e3896d31241aa748.tar.gz
Refactor builds view
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index b4d91b1b0c3..41eeb9a4ce4 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -16,6 +16,7 @@ class CommitStatus < ActiveRecord::Base
scope :success, -> { where(status: 'success') }
scope :failed, -> { where(status: 'failed') }
scope :running_or_pending, -> { where(status:[:running, :pending]) }
+ scope :finished, -> { where(status:[:success, :failed, :canceled]) }
scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)) }
scope :ordered, -> { order(:ref, :stage_idx, :name) }
scope :for_ref, ->(ref) { where(ref: ref) }