summaryrefslogtreecommitdiff
path: root/app/controllers/projects/artifacts_controller.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-11 18:51:23 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-11 18:51:23 +0800
commitef833a220508f6f8a692b74e7fe593c68981d6f5 (patch)
tree21f70f3c625f431748173bd7db62e756ec790294 /app/controllers/projects/artifacts_controller.rb
parentb14d40f0b0b46aba95d15b139345674c6a3dbd09 (diff)
downloadgitlab-ce-ef833a220508f6f8a692b74e7fe593c68981d6f5.tar.gz
Give latest succeeded one, don't give pending/running ones
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r--app/controllers/projects/artifacts_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index c00295cd3b5..f71499be4f7 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -61,7 +61,9 @@ class Projects::ArtifactsController < Projects::ApplicationController
def build_from_ref
if params[:ref]
- project.builds_for(params[:build_name], params[:ref]).latest.first
+ builds = project.builds_for(params[:build_name], params[:ref])
+
+ builds.latest.success.first
end
end