Skip to content

Commit 4b823e1

Browse files
committed
Eager load ActionDispatch::Routing::RoutesProxy
Otherwise it might only be loaded once `url_for` is called: ``` from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/routes_proxy.rb:7:in `<module:Routing>' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/routes_proxy.rb:6:in `<module:ActionDispatch>' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/routes_proxy.rb:5:in `<main>' from gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require' from gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb:214:in `polymorphic_method' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb:116:in `polymorphic_url' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/url_for.rb:187:in `full_url_for' from bundler/gems/rails-5772ecd7d568/actionpack/lib/action_dispatch/routing/url_for.rb:170:in `url_for' ```
1 parent 9ae0521 commit 4b823e1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

actionpack/lib/action_dispatch/routing.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ module Routing
250250

251251
autoload :Mapper
252252
autoload :RouteSet
253-
autoload :RoutesProxy
253+
eager_autoload do
254+
autoload :RoutesProxy
255+
end
254256
autoload :UrlFor
255257
autoload :PolymorphicRoutes
256258

0 commit comments

Comments
 (0)