aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/engine.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/engine.rb')
-rw-r--r--railties/lib/rails/engine.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb
index 1aa24b6808..f8caaef213 100644
--- a/railties/lib/rails/engine.rb
+++ b/railties/lib/rails/engine.rb
@@ -419,9 +419,9 @@ module Rails
}
end
- def routes(&block)
+ def routes
@routes ||= ActionDispatch::Routing::RouteSet.new
- self.routes_draw_block = block if block_given?
+ @routes.append(&Proc.new) if block_given?
@routes
end
@@ -472,8 +472,8 @@ module Rails
paths = self.paths["config/routes"].existent
if routes? || paths.any?
- app.routes_reloader.blocks[routes] = routes_draw_block
app.routes_reloader.paths.unshift(*paths)
+ app.routes_reloader.route_sets << routes
end
end
@@ -523,8 +523,6 @@ module Rails
end
protected
- attr_accessor :routes_draw_block
-
def routes?
defined?(@routes)
end