diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-06 21:41:37 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-10-06 21:41:37 +0200 |
commit | 82b6a17ca70a20015e654b4a0fdb8aec6d244f95 (patch) | |
tree | 98b9229c66aa6605147ee9200635ce756bbd7562 /app | |
parent | 27b75b2b2d9c274fca005949f645d97ce9333d71 (diff) | |
download | gitlab-ce-ci-build-page.tar.gz |
Fix ci build routing and few testsci-build-page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/ci/builds_controller.rb | 8 | ||||
-rw-r--r-- | app/helpers/builds_helper.rb | 2 | ||||
-rw-r--r-- | app/models/ci/build.rb | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/app/controllers/ci/builds_controller.rb b/app/controllers/ci/builds_controller.rb index daf3bcf72a9..b0b8b62fced 100644 --- a/app/controllers/ci/builds_controller.rb +++ b/app/controllers/ci/builds_controller.rb @@ -17,7 +17,7 @@ module Ci if params[:return_to] redirect_to URI.parse(params[:return_to]).path else - redirect_to ci_project_build_path(project, build) + redirect_to build_path(build) end end @@ -28,7 +28,7 @@ module Ci def cancel @build.cancel - redirect_to ci_project_build_path(@project, @build) + redirect_to build_path(@build) end protected @@ -44,5 +44,9 @@ module Ci def commit_by_sha @project.commits.find_by(sha: params[:id]) end + + def build_path(build) + namespace_project_build_path(build.gl_project.namespace, build.gl_project, build) + end end end diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb index 626f4e2f4c0..1b5a2c31d74 100644 --- a/app/helpers/builds_helper.rb +++ b/app/helpers/builds_helper.rb @@ -8,6 +8,6 @@ module BuildsHelper end def build_url(build) - ci_project_build_url(build.project, build) + namespace_project_build_path(build.gl_project, build.project, build) end end diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 3c92710968c..5d17f4418ed 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -144,7 +144,7 @@ module Ci state :canceled, value: 'canceled' end - delegate :sha, :short_sha, :project, + delegate :sha, :short_sha, :project, :gl_project, to: :commit, prefix: false def before_sha |