summaryrefslogtreecommitdiff
path: root/config/initializers/routing_draw.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-11-07 17:14:34 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-11-07 17:14:34 +0200
commit41990128a33c268f3af2db80f4ac224802ac8b76 (patch)
tree7ea608a1df680bcc570dcc8c249c27ea25bea50d /config/initializers/routing_draw.rb
parent76ff9fffcce353e33f407b78cf4256ef4dc50f6a (diff)
downloadgitlab-ce-41990128a33c268f3af2db80f4ac224802ac8b76.tar.gz
Refactor project routingdz-refactor-project-routes
* split on multiple files * improve routing order Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'config/initializers/routing_draw.rb')
-rw-r--r--config/initializers/routing_draw.rb7
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