summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/commit.rb2
-rw-r--r--app/models/concerns/has_status.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 0e2ab76d347..e64fd1e0c1b 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -231,7 +231,7 @@ class Commit
def status
return @status if defined?(@status)
- @status ||= pipelines.order(:id).last.try(:status)
+ @status ||= pipelines.status
end
def revert_branch_name
diff --git a/app/models/concerns/has_status.rb b/app/models/concerns/has_status.rb
index 77fc66a7105..d658552f695 100644
--- a/app/models/concerns/has_status.rb
+++ b/app/models/concerns/has_status.rb
@@ -20,7 +20,7 @@ module HasStatus
skipped = scope.skipped.select('count(*)').to_sql
deduce_status = "(CASE
- WHEN (#{builds})=0 THEN NULL
+ WHEN (#{builds})=(#{created}) THEN NULL
WHEN (#{builds})=(#{skipped}) THEN 'skipped'
WHEN (#{builds})=(#{success})+(#{ignored})+(#{skipped}) THEN 'success'
WHEN (#{builds})=(#{created})+(#{pending})+(#{skipped}) THEN 'pending'