mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Cache url_helpers
`url_helpers` used to be memoized. This was lost in a refactoring and this PR adds it back. We noticed this while investigating why integration tests are slower than controller tests.
This commit is contained in:
parent
e6d8f435a9
commit
3b637802b2
1 changed files with 50 additions and 48 deletions
|
@ -410,6 +410,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
def url_helpers(supports_path = true)
|
def url_helpers(supports_path = true)
|
||||||
|
@url_helpers ||= begin
|
||||||
routes = self
|
routes = self
|
||||||
|
|
||||||
Module.new do
|
Module.new do
|
||||||
|
@ -467,6 +468,7 @@ module ActionDispatch
|
||||||
private :_generate_paths_by_default
|
private :_generate_paths_by_default
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def empty?
|
def empty?
|
||||||
routes.empty?
|
routes.empty?
|
||||||
|
|
Loading…
Reference in a new issue