summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-12 16:32:58 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-12 16:32:58 +0200
commit789fe7b4899fb97c48ad363c5ecb1969d78d1536 (patch)
tree3a35d2d561ae057f2c161717ed8d6b54b8a77dbb /app/models/commit_status.rb
parent69c04498ef0a49186a667fd44383b9b43690a91e (diff)
downloadgitlab-ce-789fe7b4899fb97c48ad363c5ecb1969d78d1536.tar.gz
Update rendering
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index b6234c896e3..b4d91b1b0c3 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -16,8 +16,9 @@ class CommitStatus < ActiveRecord::Base
scope :success, -> { where(status: 'success') }
scope :failed, -> { where(status: 'failed') }
scope :running_or_pending, -> { where(status:[:running, :pending]) }
- scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)).order(stage_idx: :asc) }
- scope :for_ref, ->(ref) { where(ref: [ref, nil]) }
+ 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) }
scope :running_or_pending, -> { where(status: [:running, :pending]) }
state_machine :status, initial: :pending do