diff options
author | Emilio Tagua <miloops@gmail.com> | 2009-08-17 19:46:06 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2009-08-17 19:46:06 -0300 |
commit | c01c8967a02537f132d437d5ae15332982119651 (patch) | |
tree | 76ed47f6bffd5fe1aa11c65cd32b222d881f43aa /actionpack/lib/action_controller/routing/route_set.rb | |
parent | 770fca10fba68fa14308f33e923493e6f63bfa35 (diff) | |
parent | ccf28d2499d1b4e2aba41291eb800e0e02120923 (diff) | |
download | rails-c01c8967a02537f132d437d5ae15332982119651.tar.gz rails-c01c8967a02537f132d437d5ae15332982119651.tar.bz2 rails-c01c8967a02537f132d437d5ae15332982119651.zip |
Merge commit 'rails/master'
Conflicts:
activerecord/lib/active_record/calculations.rb
Diffstat (limited to 'actionpack/lib/action_controller/routing/route_set.rb')
-rw-r--r-- | actionpack/lib/action_controller/routing/route_set.rb | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/actionpack/lib/action_controller/routing/route_set.rb b/actionpack/lib/action_controller/routing/route_set.rb index 09f6024d39..a4f54ad662 100644 --- a/actionpack/lib/action_controller/routing/route_set.rb +++ b/actionpack/lib/action_controller/routing/route_set.rb @@ -407,22 +407,9 @@ module ActionController # don't use the recalled keys when determining which routes to check routes = routes_by_controller[controller][action][options.reject {|k,v| !v}.keys.sort_by { |x| x.object_id }] - routes[1].each_with_index do |route, index| + routes.each_with_index do |route, index| results = route.__send__(method, options, merged, expire_on) if results && (!results.is_a?(Array) || results.first) - - # Compare results with Rails 3.0 behavior - if routes[0][index] != route - routes[0].each do |route2| - new_results = route2.__send__(method, options, merged, expire_on) - if new_results && (!new_results.is_a?(Array) || new_results.first) - ActiveSupport::Deprecation.warn "The URL you generated will use the first matching route in routes.rb rather than the \"best\" match. " + - "In Rails 3.0 #{new_results} would of been generated instead of #{results}" - break - end - end - end - return results end end @@ -463,10 +450,7 @@ module ActionController @routes_by_controller ||= Hash.new do |controller_hash, controller| controller_hash[controller] = Hash.new do |action_hash, action| action_hash[action] = Hash.new do |key_hash, keys| - key_hash[keys] = [ - routes_for_controller_and_action_and_keys(controller, action, keys), - deprecated_routes_for_controller_and_action_and_keys(controller, action, keys) - ] + key_hash[keys] = routes_for_controller_and_action_and_keys(controller, action, keys) end end end @@ -487,15 +471,6 @@ module ActionController end end - def deprecated_routes_for_controller_and_action_and_keys(controller, action, keys) - selected = routes.select do |route| - route.matches_controller_and_action? controller, action - end - selected.sort_by do |route| - (keys - route.significant_keys).length - end - end - # Subclasses and plugins may override this method to extract further attributes # from the request, for use by route conditions and such. def extract_request_environment(request) |