summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-10-16 11:26:48 +0200
committerDouwe Maan <douwe@gitlab.com>2015-10-16 11:26:48 +0200
commit34148d15764898579cc44ea02f439e8359e01233 (patch)
treef390aff9f58f2f26fab1c99915c9dd73babe6ea0 /app/models/commit_status.rb
parent95f0440a7823a927ebba1557b091c12255e49ac4 (diff)
parentbd3689e9e0aebe43f7c5f787e03a3bbaa8b2ef68 (diff)
downloadgitlab-ce-34148d15764898579cc44ea02f439e8359e01233.tar.gz
Merge branch 'master' into rs-redactor-filterrs-redactor-filter
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb3
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