diff options
author | José Valim <jose.valim@gmail.com> | 2010-05-16 14:34:36 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-16 14:34:36 +0200 |
commit | 6cabc9a61fd78a7cbc06d083a59cb252794e5a97 (patch) | |
tree | 3f35e1a6f3db157cd85b9e630cfb2fa99862cba8 /railties | |
parent | 2dc1402417242784a738321e7edd521f8ec7ac83 (diff) | |
download | rails-6cabc9a61fd78a7cbc06d083a59cb252794e5a97.tar.gz rails-6cabc9a61fd78a7cbc06d083a59cb252794e5a97.tar.bz2 rails-6cabc9a61fd78a7cbc06d083a59cb252794e5a97.zip |
Add some comments related to Hash method check.
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 |