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
Boxiang Sun
gitlab-ce
Commits
d045df3d
Commit
d045df3d
authored
Oct 23, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow CE do nothing if route doesn't exist
parent
52fa309e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
doc/development/ee_features.md
doc/development/ee_features.md
+5
-4
lib/gitlab/patch/draw_route.rb
lib/gitlab/patch/draw_route.rb
+2
-2
spec/fast_spec_helper.rb
spec/fast_spec_helper.rb
+1
-0
No files found.
doc/development/ee_features.md
View file @
d045df3d
...
@@ -338,13 +338,14 @@ When we add `draw :admin` in `config/routes.rb`, the application will try to
...
@@ -338,13 +338,14 @@ When we add `draw :admin` in `config/routes.rb`, the application will try to
load the file located in
`config/routes/admin.rb`
, and also try to load the
load the file located in
`config/routes/admin.rb`
, and also try to load the
file located in
`ee/config/routes/admin.rb`
.
file located in
`ee/config/routes/admin.rb`
.
It should at least load one file, at most two files. If it cannot find any
In EE, it should at least load one file, at most two files. If it cannot find
files, an error will be raised.
any files, an error will be raised. In CE, since we don't know if there will
be an EE route, it will not raise any errors even if it cannot find anything.
This means if we want to extend a particular CE route file, just add the same
This means if we want to extend a particular CE route file, just add the same
file located in
`ee/config/routes`
. If we want to add an EE only route, we
file located in
`ee/config/routes`
. If we want to add an EE only route, we
could still
use
`draw :ee_only`
and add
`ee/config/routes/ee_only.rb`
without
could still
put
`draw :ee_only`
in both CE and EE, and add
adding
`config/routes/ee_only.rb
`
.
`ee/config/routes/ee_only.rb`
in EE, similar to
`render_if_exists
`
.
### Code in `app/controllers/`
### Code in `app/controllers/`
...
...
lib/gitlab/patch/draw_route.rb
View file @
d045df3d
...
@@ -16,8 +16,8 @@ module Gitlab
...
@@ -16,8 +16,8 @@ module Gitlab
draw_route
(
route_path
(
"config/routes/
#{
routes_name
}
.rb"
))
draw_route
(
route_path
(
"config/routes/
#{
routes_name
}
.rb"
))
end
end
def
draw_ee
(
routes_name
)
def
draw_ee
(
_
)
draw_route
(
route_path
(
"ee/config/routes/
#{
routes_name
}
.rb"
))
true
end
end
def
route_path
(
routes_name
)
def
route_path
(
routes_name
)
...
...
spec/fast_spec_helper.rb
View file @
d045df3d
...
@@ -8,3 +8,4 @@ require_relative 'support/rspec'
...
@@ -8,3 +8,4 @@ require_relative 'support/rspec'
require
'active_support/all'
require
'active_support/all'
ActiveSupport
::
Dependencies
.
autoload_paths
<<
'lib'
ActiveSupport
::
Dependencies
.
autoload_paths
<<
'lib'
ActiveSupport
::
Dependencies
.
autoload_paths
<<
'ee/lib'
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