diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-07-07 18:37:04 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-07-07 18:37:04 +0000 |
commit | 426271dacbb3b7462e4f7a78fa3628bbd267609a (patch) | |
tree | 930dabccfd90cfad90e7aa86dd557bc309c075c9 /config | |
parent | 787a23475a6de02438608d2af8d21577afbbd447 (diff) | |
parent | c81928cfa757b6f42debd6d1c3b6cdb860fc14f5 (diff) | |
download | gitlab-ce-426271dacbb3b7462e4f7a78fa3628bbd267609a.tar.gz |
Merge branch 'dm-fix-project-path-helpers-production' into 'master'
Include new URL helpers retroactively into includers of Gitlab::Routing
Closes #34821
See merge request !12716
Diffstat (limited to 'config')
-rw-r--r-- | config/application.rb | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/config/application.rb b/config/application.rb index 3e6d72810cd..d88740ef8d7 100644 --- a/config/application.rb +++ b/config/application.rb @@ -166,9 +166,10 @@ module Gitlab config.after_initialize do Rails.application.reload_routes! - named_routes_set = Gitlab::Application.routes.named_routes project_url_helpers = Module.new do - named_routes_set.helper_names.each do |name| + extend ActiveSupport::Concern + + Gitlab::Application.routes.named_routes.helper_names.each do |name| next unless name.include?('namespace_project') define_method(name.sub('namespace_project', 'project')) do |project, *args| @@ -177,14 +178,7 @@ module Gitlab end end - named_routes_set.url_helpers_module.include project_url_helpers - named_routes_set.url_helpers_module.extend project_url_helpers - - Gitlab::Routing.url_helpers.include project_url_helpers - Gitlab::Routing.url_helpers.extend project_url_helpers - - GitlabRoutingHelper.include project_url_helpers - GitlabRoutingHelper.extend project_url_helpers + Gitlab::Routing.add_helpers(project_url_helpers) end end end |