summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-12-07 12:47:06 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2016-12-07 12:47:06 +0100
commitc4e46c5740426f656c019b51b9731ea8a16f42d0 (patch)
tree50df5b6ae486b1b76f0b5feeede48b91d4c1cdfa
parent953a10947bea8ff75290cd50fae4ae1f7636a71d (diff)
downloadgitlab-ce-c4e46c5740426f656c019b51b9731ea8a16f42d0.tar.gz
Fix success status
-rw-r--r--app/models/ci/pipeline.rb3
-rw-r--r--app/models/concerns/has_status.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index d14825c082a..fda8228a1e9 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -105,7 +105,8 @@ module Ci
end
def stages_name
- statuses.order(:stage_idx).distinct.pluck(:stage)
+ statuses.order(:stage_idx).distinct.
+ pluck(:stage, :stage_idx).map(&:first)
end
def stages
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index 43f312d319e..90432fc4050 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -26,7 +26,7 @@ module HasStatus
WHEN (#{builds})=(#{skipped}) THEN 'skipped'
WHEN (#{builds})=(#{success}) THEN 'success'
WHEN (#{builds})=(#{created}) THEN 'created'
- WHEN (#{builds})=(#{success})+(#{skipped}) THEN 'skipped'
+ WHEN (#{builds})=(#{success})+(#{skipped}) THEN 'success'
WHEN (#{builds})=(#{success})+(#{skipped})+(#{canceled}) THEN 'canceled'
WHEN (#{builds})=(#{created})+(#{skipped})+(#{pending}) THEN 'pending'
WHEN (#{running})+(#{pending})+(#{created})>0 THEN 'running'