From 757379128442d07ebebd7a3d22853d016cfb95b4 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sat, 22 Sep 2007 19:20:06 +0000 Subject: Disable the routing optimisation code when dealing with foo_url helpers. Add test to actionmailer to expose the problem they introduced. References #9450 [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing_optimisation.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller/routing_optimisation.rb') diff --git a/actionpack/lib/action_controller/routing_optimisation.rb b/actionpack/lib/action_controller/routing_optimisation.rb index 7cf85c9b9a..fdd5a81c19 100644 --- a/actionpack/lib/action_controller/routing_optimisation.rb +++ b/actionpack/lib/action_controller/routing_optimisation.rb @@ -41,8 +41,10 @@ module ActionController end end + # Temporarily disabled :url optimisation pending proper solution to + # Issues around request.host etc. def applicable? - true + kind != :url end end @@ -76,7 +78,7 @@ module ActionController # The last entry in route.segments appears to # *always* be a # 'divider segment' for '/' but we have assertions to ensure that # we don't include the trailing slashes, so skip them. - ((route.segments.size == 1 && kind == :path) ? route.segments : route.segments[0..-2]).each do |segment| + (route.segments.size == 1 ? route.segments : route.segments[0..-2]).each do |segment| if segment.is_a?(DynamicSegment) elements << segment.interpolation_chunk("args[#{idx}].to_param") idx += 1 @@ -105,7 +107,7 @@ module ActionController # To avoid generating http://localhost/?host=foo.example.com we # can't use this optimisation on routes without any segments def applicable? - route.segment_keys.size > 0 + super && route.segment_keys.size > 0 end end -- cgit v1.2.3