diff options
author | Douwe Maan <douwe@selenight.nl> | 2019-07-22 14:25:56 +0200 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2019-07-22 14:31:40 +0200 |
commit | 26ac53b3536b641a8875b9b41047e8154ed58f1c (patch) | |
tree | e66299439afdcaf66c5fd4a105d46f084c5a03cd /app/helpers | |
parent | 65b16f9894c11c6c05762b04b2721bc26972e788 (diff) | |
download | gitlab-ce-26ac53b3536b641a8875b9b41047e8154ed58f1c.tar.gz |
Ensure SubmoduleHelper works outside view contextdm-submodule-helper-routing
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/submodule_helper.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/helpers/submodule_helper.rb b/app/helpers/submodule_helper.rb index 35e04b0ced3..9a281065b90 100644 --- a/app/helpers/submodule_helper.rb +++ b/app/helpers/submodule_helper.rb @@ -34,8 +34,8 @@ module SubmoduleHelper project.sub!(/\.git\z/, '') if self_url?(url, namespace, project) - [namespace_project_path(namespace, project), - namespace_project_tree_path(namespace, project, submodule_item_id)] + [url_helpers.namespace_project_path(namespace, project), + url_helpers.namespace_project_tree_path(namespace, project, submodule_item_id)] elsif relative_self_url?(url) relative_self_links(url, submodule_item_id, repository.project) elsif github_dot_com_url?(url) @@ -99,8 +99,8 @@ module SubmoduleHelper begin [ - namespace_project_path(target_namespace_path, submodule_base), - namespace_project_tree_path(target_namespace_path, submodule_base, commit) + url_helpers.namespace_project_path(target_namespace_path, submodule_base), + url_helpers.namespace_project_tree_path(target_namespace_path, submodule_base, commit) ] rescue ActionController::UrlGenerationError [nil, nil] @@ -118,4 +118,8 @@ module SubmoduleHelper rescue URI::InvalidURIError nil end + + def url_helpers + Gitlab::Routing.url_helpers + end end |