mirror of
https://github.com/github/rails.git
synced 2026-01-31 01:08:19 -05:00
Make sure the expiry hash is built by comparing the to_param-ized values of each hash
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6465 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user