From 036f77574d5cd095b9ea78e2fd927c8d7764bd31 Mon Sep 17 00:00:00 2001 From: thedarkone Date: Mon, 6 Jun 2011 14:13:06 +0200 Subject: Make polymorphic_url calls go through application helpers again. This brings back the ability to overwrite/extend url generating methods in application heleprs. --- actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb') diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 49aef0bf72..e989a38d8b 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -124,14 +124,7 @@ module ActionDispatch args.last.kind_of?(Hash) ? args.last.merge!(url_options) : args << url_options end - if proxy - proxy.send(named_route, *args) - else - # we need to use url_for, because polymorphic_url can be used in context of other than - # current routes (e.g. engine's routes). As named routes from engine are not included - # calling engine's named route directly would fail. - url_for _routes.url_helpers.__send__("hash_for_#{named_route}", *args) - end + (proxy || self).send(named_route, *args) end # Returns the path component of a URL for the given record. It uses -- cgit v1.2.3