Ticket #9573: action_pack_routing_sorts_possible_controllers.diff
| File action_pack_routing_sorts_possible_controllers.diff, 1.3 kB (added by danger, 1 year ago) |
|---|
-
actionpack/test/controller/routing_test.rb
old new 1989 1989 RAILS_ROOT, RAILS_ROOT + '/app/controllers', RAILS_ROOT + '/vendor/plugins/bad_plugin/lib' 1990 1990 ] 1991 1991 1992 assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers .sort1992 assert_equal ["admin/user", "plugin", "user"], ActionController::Routing.possible_controllers 1993 1993 ensure 1994 1994 if true_controller_paths 1995 1995 ActionController::Routing.controller_paths = true_controller_paths -
actionpack/lib/action_controller/routing.rb
old new 317 317 318 318 seen_paths = Hash.new {|h, k| h[k] = true; false} 319 319 normalize_paths(paths).each do |load_path| 320 Dir["#{load_path}/**/*_controller.rb"]. collect do |path|320 Dir["#{load_path}/**/*_controller.rb"].sort.collect do |path| 321 321 next if seen_paths[path.gsub(%r{^\.[/\\]}, "")] 322 322 323 323 controller_name = path[(load_path.length + 1)..-1]