diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-10-21 11:36:41 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-10-21 11:36:41 +0200 |
commit | de0acf3cf7f27e7a4f32dc8cad6293f823eda300 (patch) | |
tree | 4f5810004fd2f23d5491116ca4f919efea88ee88 /app/models/commit_status.rb | |
parent | 9c2214f202e98d0427d86a57888574327a6607dd (diff) | |
parent | d25b50fda63e830cb2c87281bba064b71185e712 (diff) | |
download | gitlab-ce-de0acf3cf7f27e7a4f32dc8cad6293f823eda300.tar.gz |
Merge branch 'master' into reference-pipeline-and-caching
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 92905c618eb..8188ba3a28e 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) } @@ -27,7 +28,7 @@ class CommitStatus < ActiveRecord::Base end event :drop do - transition running: :failed + transition [:pending, :running] => :failed end event :success do |