summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-22 01:48:41 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-22 01:48:41 +0800
commit66301ce274b42cefe76e343a3d545c8f12d847b2 (patch)
tree1f4370e70bbcc0a734223b475d4c9e9946f67764
parentdd6b16a111a6e6cce0be322be8ddba17a2a30534 (diff)
downloadgitlab-ce-66301ce274b42cefe76e343a3d545c8f12d847b2.tar.gz
Filter against status first, otherwise we can't
find the latest successful one if the last one is failed and we already exclude the others.
-rw-r--r--app/models/ci/pipeline.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 95af8c72309..61d9316a5d3 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -105,7 +105,7 @@ module Ci
end
def self.latest_successful_for(ref)
- latest_for(ref).success.first
+ success.latest_for(ref).first
end
def self.truncate_sha(sha)