From 0b1ce078228f404be63378c000e1af0ee992a321 Mon Sep 17 00:00:00 2001 From: Issei Naruta Date: Tue, 21 Feb 2012 18:35:31 +0900 Subject: Bug: cache_path.size doesn't return length of filename but size of file if cache_path is Pathname. --- activesupport/lib/active_support/cache/file_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index 9460532af0..b7712a4a15 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -143,7 +143,7 @@ module ActiveSupport # Translate a file path into a key. def file_path_key(path) - fname = path[cache_path.size, path.size].split(File::SEPARATOR, 4).last + fname = path[cache_path.to_s.size..-1].split(File::SEPARATOR, 4).last Rack::Utils.unescape(fname) end -- cgit v1.2.3