Bug in routing.rb, line 290: Dir#{load_path}/**/*_controller.rb?.collect does not return the proper order for the rb files, which need to be sorted before. Otherwise different behavior is observed in different file systems.
That line is the basic generator for the order in which routes will be matched to their rule(since it is the basis for the regular expression that does the matching), and the change of that order can alter behavior.
Example:
With the route mapping: map.connect ':controller/:action/:id'
The URL '/admin/statistics' will be sometimes mapped as:
{"action"=>"index", "controller"=>"admin/statistics"}
and sometimes as:
{"action"=>"statistics", "controller"=>"admin"}
when in both case the two following files existed:
- app/controllers/admin/statistics_controller.rb
- app/controllers/admin_controller.rb
The unpredictability of that behavior makes it slightly problematic.
Preferred behavior would be load sub-controllers first as in attached patch(their existence is at least guaranteed)