Permalink
Browse files

only ask for the routes module once

we can cache the module on the stack, then reuse it
  • Loading branch information...
1 parent d2d3376 commit a2e926698dfa9bb978958b181b3ed5c80fee8c6e @tenderlove tenderlove committed Jul 29, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -401,14 +401,16 @@ class << self
def url_options; {}; end
end
+ route_methods = routes.named_routes.module
+
# Make named_routes available in the module singleton
# as well, so one can do:
# Rails.application.routes.url_helpers.posts_path
- extend routes.named_routes.module
+ extend route_methods
# Any class that includes this module will get all
# named routes...
- include routes.named_routes.module
+ include route_methods
# plus a singleton class method called _routes ...
included do

0 comments on commit a2e9266

Please sign in to comment.