aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing_optimisation.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-09-22 19:20:06 +0000
committerMichael Koziarski <michael@koziarski.com>2007-09-22 19:20:06 +0000
commit757379128442d07ebebd7a3d22853d016cfb95b4 (patch)
tree0b805cc6f302322e04eea62eeb75fd13362b70d4 /actionpack/lib/action_controller/routing_optimisation.rb
parentdefb4d08dca88500f172da9e90e5af19187c7b08 (diff)
downloadrails-757379128442d07ebebd7a3d22853d016cfb95b4.tar.gz
rails-757379128442d07ebebd7a3d22853d016cfb95b4.tar.bz2
rails-757379128442d07ebebd7a3d22853d016cfb95b4.zip
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
Diffstat (limited to 'actionpack/lib/action_controller/routing_optimisation.rb')
-rw-r--r--actionpack/lib/action_controller/routing_optimisation.rb8
1 files changed, 5 insertions, 3 deletions
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