diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-11-08 13:04:02 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-11-08 13:04:02 +0000 |
commit | 35142a097865b1083ddea95c8507aab07e52a4ed (patch) | |
tree | 0abf6c8df6537d0bdb61a14d4cd610528bdae738 /config/initializers | |
parent | 7be41074bb6596a41a5b6689ee98ab02cf4be50a (diff) | |
parent | 41990128a33c268f3af2db80f4ac224802ac8b76 (diff) | |
download | gitlab-ce-35142a097865b1083ddea95c8507aab07e52a4ed.tar.gz |
Merge branch 'dz-refactor-project-routes' into 'master'
Refactor project routing
## What does this MR do?
Refactor project routing:
* split on multiple files
* improve routing order
## Why was this MR needed?
It makes it easier to maintain and modify project routing
## What are the relevant issue numbers?
Extracted from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7121
See merge request !7329
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/routing_draw.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/config/initializers/routing_draw.rb b/config/initializers/routing_draw.rb new file mode 100644 index 00000000000..25003cf0239 --- /dev/null +++ b/config/initializers/routing_draw.rb @@ -0,0 +1,7 @@ +# Adds draw method into Rails routing +# It allows us to keep routing splitted into files +class ActionDispatch::Routing::Mapper + def draw(routes_name) + instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) + end +end |