diff options
author | Aleksandr Koss <kossnocorp@gmail.com> | 2010-05-15 20:15:23 +0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-16 14:32:48 +0200 |
commit | 3e84ea014e9f4d0f8d302c9bf8ad04240eec2804 (patch) | |
tree | 47d3100e513d040dbf498e94e36799f63d18ce4c /railties | |
parent | 1a2d556de7935588e04c541e6c0804b5533db6b5 (diff) | |
download | rails-3e84ea014e9f4d0f8d302c9bf8ad04240eec2804.tar.gz rails-3e84ea014e9f4d0f8d302c9bf8ad04240eec2804.tar.bz2 rails-3e84ea014e9f4d0f8d302c9bf8ad04240eec2804.zip |
Fix Hash#index deprecated warning in 1.9.x [#4600 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/tasks/routes.rake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/tasks/routes.rake b/railties/lib/rails/tasks/routes.rake index 42e01d5e51..4bb94d39ea 100644 --- a/railties/lib/rails/tasks/routes.rake +++ b/railties/lib/rails/tasks/routes.rake @@ -3,7 +3,8 @@ 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| - name = Rails.application.routes.named_routes.routes.index(route).to_s + 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 {:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs} end |