Just use instance variable instead, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14400736
This commit is contained in:
parent
6953d988ab
commit
dd8afbf05d
1 changed files with 2 additions and 7 deletions
|
@ -37,8 +37,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def latest_succeeded
|
||||
path = ref_name_and_path.last
|
||||
target_path = artifacts_action_path(path, project, build)
|
||||
target_path = artifacts_action_path(@path, project, build)
|
||||
|
||||
if target_path
|
||||
redirect_to(target_path)
|
||||
|
@ -63,17 +62,13 @@ class Projects::ArtifactsController < Projects::ApplicationController
|
|||
|
||||
def build_from_ref
|
||||
if params[:ref_name_and_path]
|
||||
ref_name = ref_name_and_path.first
|
||||
ref_name, @path = extract_ref(params[:ref_name_and_path])
|
||||
builds = project.latest_successful_builds_for(ref_name)
|
||||
|
||||
builds.find_by(name: params[:job])
|
||||
end
|
||||
end
|
||||
|
||||
def ref_name_and_path
|
||||
@ref_name_and_path ||= extract_ref(params[:ref_name_and_path])
|
||||
end
|
||||
|
||||
def artifacts_file
|
||||
@artifacts_file ||= build.artifacts_file
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue