Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
5ae45926
Commit
5ae45926
authored
Jul 08, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also inject new route helpers into includers of GitlabRoutingHelper
parent
69e17c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+4
-0
lib/gitlab/routing.rb
lib/gitlab/routing.rb
+9
-4
No files found.
app/helpers/gitlab_routing_helper.rb
View file @
5ae45926
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
module
GitlabRoutingHelper
module
GitlabRoutingHelper
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
included
do
Gitlab
::
Routing
.
includes_helpers
(
self
)
end
# Project
# Project
def
project_tree_path
(
project
,
ref
=
nil
,
*
args
)
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
namespace_project_tree_path
(
project
.
namespace
,
project
,
ref
||
@ref
||
project
.
repository
.
root_ref
,
*
args
)
# rubocop:disable Cop/ProjectPathHelper
...
...
lib/gitlab/routing.rb
View file @
5ae45926
...
@@ -6,21 +6,26 @@ module Gitlab
...
@@ -6,21 +6,26 @@ module Gitlab
self
.
_includers
=
[]
self
.
_includers
=
[]
included
do
included
do
Gitlab
::
Routing
.
_includers
<<
self
Gitlab
::
Routing
.
includes_helpers
(
self
)
include
Gitlab
::
Routing
.
url_helpers
include
Gitlab
::
Routing
.
url_helpers
end
end
def
self
.
includes_helpers
(
klass
)
self
.
_includers
<<
klass
end
def
self
.
add_helpers
(
mod
)
def
self
.
add_helpers
(
mod
)
url_helpers
.
include
mod
url_helpers
.
include
mod
url_helpers
.
extend
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
=
Gitlab
::
Application
.
routes
.
named_routes
.
url_helpers_module
app_url_helpers
.
include
mod
app_url_helpers
.
include
mod
app_url_helpers
.
extend
mod
app_url_helpers
.
extend
mod
GitlabRoutingHelper
.
include
mod
GitlabRoutingHelper
.
extend
mod
_includers
.
each
do
|
klass
|
_includers
.
each
do
|
klass
|
klass
.
include
mod
klass
.
include
mod
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment