diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/tasks/routes.rake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake index 4bb94d39ea..41619bc1f8 100644 --- a/railties/lib/rails/tasks/routes.rake +++ b/railties/lib/rails/tasks/routes.rake @@ -3,6 +3,9 @@ task :routes => :environment do Rails::Application.reload_routes! all_routes = ENV['CONTROLLER'] ? Rails.application.routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : Rails.application.routes.routes routes = all_routes.collect do |route| + # TODO: The :index method is deprecated in 1.9 in favor of :key + # but we don't have :key in 1.8.7. We can remove this check when + # stop supporting 1.8.x key_method = Hash.method_defined?('key') ? 'key' : 'index' name = Rails.application.routes.named_routes.routes.send(key_method, route).to_s reqs = route.requirements.empty? ? "" : route.requirements.inspect |