summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2015-10-15 11:35:57 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2015-10-15 11:35:57 +0000
commitdaccc54d25a5acfd089e02fd7387ed14f0a3a629 (patch)
tree23022a603117e114ea608c7fa3e842a615f8faf6 /app/models/commit_status.rb
parent524b3db30ca53449c13cb6bb9a518cfc2c0cacf7 (diff)
parent9fa209e1d8748b1eb1ef041bb1c40d30914f2815 (diff)
downloadgitlab-ce-daccc54d25a5acfd089e02fd7387ed14f0a3a629.tar.gz
Merge branch 'builds-view' into 'master'
Added builds view ![Screen_Shot_2015-10-13_at_19.02.48](https://gitlab.com/gitlab-org/gitlab-ce/uploads/95bb3a7d9d603678fdd077558637045d/Screen_Shot_2015-10-13_at_19.02.48.png) /cc @dzaporozhets @vsizov See merge request !1593
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 92905c618eb..0b71838d515 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) }