Skip to content

Commit

Permalink
Fix Hash#index deprecated warning in 1.9.x [#4600 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
kossnocorp authored and josevalim committed May 16, 2010
1 parent 1a2d556 commit 3e84ea0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion railties/lib/rails/tasks/routes.rake
Expand Up @@ -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
Expand Down

0 comments on commit 3e84ea0

Please sign in to comment.