Give latest succeeded one, don't give pending/running ones

This commit is contained in:
Lin Jen-Shin 2016-07-11 18:51:23 +08:00
parent b14d40f0b0
commit ef833a2205

View file

@ -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