summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab_routing_helper.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-07-07 22:23:45 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-07-07 22:27:56 +0800
commitbcc05f03a26f5cd07bee427014276763912782b3 (patch)
tree4c6faa18b07af925f05e676d80dee0d8149181a3 /app/helpers/gitlab_routing_helper.rb
parentd40445e4c9964ae0ab793bfdd7ba530de4259716 (diff)
downloadgitlab-ce-require_gitlab_routing.tar.gz
Make sure we include after all helpers are includedrequire_gitlab_routing
Diffstat (limited to 'app/helpers/gitlab_routing_helper.rb')
-rw-r--r--app/helpers/gitlab_routing_helper.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb
index b5f4bbe97dc..d03b0264a78 100644
--- a/app/helpers/gitlab_routing_helper.rb
+++ b/app/helpers/gitlab_routing_helper.rb
@@ -2,6 +2,16 @@
module GitlabRoutingHelper
extend ActiveSupport::Concern
+ def self.require_gitlab_routing(mod = nil)
+ @require_gitlab_routing ||= []
+
+ if mod
+ @require_gitlab_routing << mod
+ else
+ @require_gitlab_routing
+ end
+ end
+
# Project
def project_tree_path(project, ref = nil, *args)
namespace_project_tree_path(project.namespace, project, ref || @ref || project.repository.root_ref, *args) # rubocop:disable Cop/ProjectPathHelper