This project is archived and is in readonly mode.

#981 ✓resolved
Matt Jones

Fix for routing optimization code

Reported by Matt Jones | September 6th, 2008 @ 12:08 PM | in 2.1.2

Related info: http://dev.rubyonrails.org/ticke... - original patch http://hobo.lighthouseapp.com/pr... - observed failure

The routing optimization code introduced by #10835 above has a serious bug - it only generates the recognize_optimized method once. This causes errors when routes are reloaded - if any are different, then the generated indexing code is not correct.

The changes in commit a5db1488251304ec93256654859b430148f0c506 caused the code to be generated at initialization, when no routes were loaded. While this prevents the above bug, it converts the efficient search intended by #10835 back into a linear search of all routes.

The attached patch re-enables efficient search while clearing the generated code when the routes are reloaded. A test for correct code generation is included - it fails on the 2.1.0 version.

--Matt Jones

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages