summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index b4d91b1b0c3..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
@@ -88,4 +89,8 @@ class CommitStatus < ActiveRecord::Base
def retry_url
nil
end
+
+ def show_warning?
+ false
+ end
end