diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-07-07 10:43:37 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-07-07 10:43:37 -0500 |
commit | c81928cfa757b6f42debd6d1c3b6cdb860fc14f5 (patch) | |
tree | 2069795e9fce322b3ab27a20c54dd8348fd4277a /config | |
parent | 1dab640357fa1ba8992757499e4167fcd4ce6276 (diff) | |
download | gitlab-ce-c81928cfa757b6f42debd6d1c3b6cdb860fc14f5.tar.gz |
Include new URL helpers retroactively into includers of Gitlab::Routingdm-fix-project-path-helpers-production
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 |