diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-12 16:32:58 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-10-12 16:32:58 +0200 |
commit | 789fe7b4899fb97c48ad363c5ecb1969d78d1536 (patch) | |
tree | 3a35d2d561ae057f2c161717ed8d6b54b8a77dbb /app/models/commit_status.rb | |
parent | 69c04498ef0a49186a667fd44383b9b43690a91e (diff) | |
download | gitlab-ce-789fe7b4899fb97c48ad363c5ecb1969d78d1536.tar.gz |
Update rendering
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 5 |
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 |