diff options
author | Marin Jankovski <marin@gitlab.com> | 2017-07-09 03:50:48 +0000 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2017-07-09 03:50:48 +0000 |
commit | f225cc9b97e97372ab035225112cd5f5d44c0e31 (patch) | |
tree | a3d1f6f3a5f21333104233cc759cd9cf7e38352c /lib | |
parent | 420f6b5474e49e17226415250846e48fe514fe0d (diff) | |
parent | 5ae4592637a134bc14f4b082f0bf2b023a884e22 (diff) | |
download | gitlab-ce-f225cc9b97e97372ab035225112cd5f5d44c0e31.tar.gz |
Merge branch 'dm-routing-helpers-fix' into 'master'31331-view-time-tracking-info-in-issue-board-contextual-sidebar29974-real-time-emoji-award-updates
Also inject new route helpers into includers of GitlabRoutingHelper
Closes #34859
See merge request !12735
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/routing.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/gitlab/routing.rb b/lib/gitlab/routing.rb index ac1e864433b..e57890f1143 100644 --- a/lib/gitlab/routing.rb +++ b/lib/gitlab/routing.rb @@ -6,21 +6,26 @@ module Gitlab self._includers = [] included do - Gitlab::Routing._includers << self + Gitlab::Routing.includes_helpers(self) + include Gitlab::Routing.url_helpers end + def self.includes_helpers(klass) + self._includers << klass + end + def self.add_helpers(mod) url_helpers.include mod url_helpers.extend mod + GitlabRoutingHelper.include mod + GitlabRoutingHelper.extend mod + app_url_helpers = Gitlab::Application.routes.named_routes.url_helpers_module app_url_helpers.include mod app_url_helpers.extend mod - GitlabRoutingHelper.include mod - GitlabRoutingHelper.extend mod - _includers.each do |klass| klass.include mod end |