mirror of https://github.com/rails/rails
only ask for the routes module once
we can cache the module on the stack, then reuse it
This commit is contained in:
parent
d2d3376903
commit
a2e926698d
|
@ -401,14 +401,16 @@ module ActionDispatch
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue