summaryrefslogtreecommitdiff
path: root/app/controllers/projects/artifacts_controller.rb
diff options
context:
space:
mode:
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