aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/routing.rb2
-rw-r--r--actionpack/test/controller/routing_test.rb9
3 files changed, 11 insertions, 2 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index d41d2dc550..c9a5aea0b2 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Make sure the route expiry hash is constructed by comparing the to_param-ized values of each hash. [Jamis Buck]
+
* Allow configuration of the default action cache path for #caches_action calls. [Rick Olson]
class ListsController < ApplicationController
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index b44dc0f901..5786e66942 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -1195,7 +1195,7 @@ module ActionController
def build_expiry(options, recall)
recall.inject({}) do |expiry, (key, recalled_value)|
- expiry[key] = (options.key?(key) && options[key] != recalled_value)
+ expiry[key] = (options.key?(key) && options[key].to_param != recalled_value.to_param)
expiry
end
end
diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb
index defc64bba2..ec34f0d35e 100644
--- a/actionpack/test/controller/routing_test.rb
+++ b/actionpack/test/controller/routing_test.rb
@@ -1793,7 +1793,14 @@ class RouteSetTest < Test::Unit::TestCase
{:controller => 'post', :action => 'show', :parameter => 1}
)
end
-
+
+ def test_expiry_determination_should_consider_values_with_to_param
+ set.draw { |map| map.connect 'projects/:project_id/:controller/:action' }
+ assert_equal '/projects/1/post/show', set.generate(
+ {:action => 'show', :project_id => 1},
+ {:controller => 'post', :action => 'show', :project_id => '1'})
+ end
+
def test_generate_all
set.draw do |map|
map.connect 'show_post/:id', :controller => 'post', :action => 'show'