Ticket #10926: posible_controllers_dir_load_fix.diff
| File posible_controllers_dir_load_fix.diff, 2.0 kB (added by maxs, 6 months ago) |
|---|
-
actionpack/test/controller/routing_test.rb
old new 2128 2128 RAILS_ROOT, RAILS_ROOT + '/app/controllers', RAILS_ROOT + '/vendor/plugins/bad_plugin/lib' 2129 2129 ] 2130 2130 2131 assert_equal [" admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort2131 assert_equal ["plugin", "admin/user", "admin", "user"], ActionController::Routing.possible_controllers 2132 2132 ensure 2133 2133 if true_controller_paths 2134 2134 ActionController::Routing.controller_paths = true_controller_paths … … 2152 2152 root, root + '/app/controllers', root + '/vendor/plugins/bad_plugin/lib' 2153 2153 ] 2154 2154 2155 assert_equal [" admin/user", "plugin", "user"], ActionController::Routing.possible_controllers.sort2155 assert_equal ["plugin", "admin/user", "admin", "user"], ActionController::Routing.possible_controllers 2156 2156 ensure 2157 2157 ActionController::Routing.controller_paths = true_controller_paths 2158 2158 ActionController::Routing.use_controllers! true_possible_controllers -
actionpack/lib/action_controller/routing.rb
old new 289 289 290 290 seen_paths = Hash.new {|h, k| h[k] = true; false} 291 291 normalize_paths(paths).each do |load_path| 292 Dir["#{load_path}/**/*_controller.rb"]. collect do |path|292 Dir["#{load_path}/**/*_controller.rb"].sort!.collect do |path| 293 293 next if seen_paths[path.gsub(%r{^\.[/\\]}, "")] 294 294 295 295 controller_name = path[(load_path.length + 1)..-1]