diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-29 12:06:35 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-07-05 11:11:59 -0500 |
commit | fe13f110412d85c05dc68e5ee1db499f681bf722 (patch) | |
tree | 4a2d172bb5a490ac8cadbcf376fbf815393ef22b /app/workers | |
parent | dc7939337e0d72d2391c3bbb3082d644a54195af (diff) | |
download | gitlab-ce-fe13f110412d85c05dc68e5ee1db499f681bf722.tar.gz |
Create and use project path helpers that only need a project, no namespace
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/expire_job_cache_worker.rb | 12 | ||||
-rw-r--r-- | app/workers/expire_pipeline_cache_worker.rb | 28 |
2 files changed, 7 insertions, 33 deletions
diff --git a/app/workers/expire_job_cache_worker.rb b/app/workers/expire_job_cache_worker.rb index 08e281e7350..e383202260d 100644 --- a/app/workers/expire_job_cache_worker.rb +++ b/app/workers/expire_job_cache_worker.rb @@ -18,18 +18,10 @@ class ExpireJobCacheWorker private def project_pipeline_path(project, pipeline) - Gitlab::Routing.url_helpers.namespace_project_pipeline_path( - project.namespace, - project, - pipeline, - format: :json) + Gitlab::Routing.url_helpers.project_pipeline_path(project, pipeline, format: :json) end def project_job_path(project, job) - Gitlab::Routing.url_helpers.namespace_project_build_path( - project.namespace, - project, - job.id, - format: :json) + Gitlab::Routing.url_helpers.project_build_path(project, job.id, format: :json) end end diff --git a/app/workers/expire_pipeline_cache_worker.rb b/app/workers/expire_pipeline_cache_worker.rb index 92e622285de..7c02d6cf892 100644 --- a/app/workers/expire_pipeline_cache_worker.rb +++ b/app/workers/expire_pipeline_cache_worker.rb @@ -23,42 +23,24 @@ class ExpirePipelineCacheWorker private def project_pipelines_path(project) - Gitlab::Routing.url_helpers.namespace_project_pipelines_path( - project.namespace, - project, - format: :json) + Gitlab::Routing.url_helpers.project_pipelines_path(project, format: :json) end def project_pipeline_path(project, pipeline) - Gitlab::Routing.url_helpers.namespace_project_pipeline_path( - project.namespace, - project, - pipeline, - format: :json) + Gitlab::Routing.url_helpers.project_pipeline_path(project, pipeline, format: :json) end def commit_pipelines_path(project, commit) - Gitlab::Routing.url_helpers.pipelines_namespace_project_commit_path( - project.namespace, - project, - commit.id, - format: :json) + Gitlab::Routing.url_helpers.pipelines_project_commit_path(project, commit.id, format: :json) end def new_merge_request_pipelines_path(project) - Gitlab::Routing.url_helpers.namespace_project_new_merge_request_path( - project.namespace, - project, - format: :json) + Gitlab::Routing.url_helpers.project_new_merge_request_path(project, format: :json) end def each_pipelines_merge_request_path(project, pipeline) pipeline.all_merge_requests.each do |merge_request| - path = Gitlab::Routing.url_helpers.pipelines_namespace_project_merge_request_path( - project.namespace, - project, - merge_request, - format: :json) + path = Gitlab::Routing.url_helpers.pipelines_project_merge_request_path(project, merge_request, format: :json) yield(path) end |