summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-11-21 22:24:09 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-11-21 22:24:09 +0800
commitdd6b16a111a6e6cce0be322be8ddba17a2a30534 (patch)
tree156f6cd50d77716f3042b81bb20dd8ae5a02fbb2
parent721f2d3788ae5e8374f357014bd9e20d62de0a81 (diff)
downloadgitlab-ce-dd6b16a111a6e6cce0be322be8ddba17a2a30534.tar.gz
Use latest_for in latest_successful_for
-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 e566503bb18..95af8c72309 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)
- where(ref: ref).order(id: :desc).success.first
+ latest_for(ref).success.first
end
def self.truncate_sha(sha)