aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-12 10:33:50 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-12 10:33:50 -0700
commit0f5b32cd0804a3fe26027176db57b8fbd9a52108 (patch)
tree40bb85372a391d84dbbb5a02ba6c6d812c24254e /activesupport/lib
parentfd22471313864c58cb911101d8c42e1fa46b4e42 (diff)
parentbe623677a3b05696e70518072576588cbeaf83cd (diff)
downloadrails-0f5b32cd0804a3fe26027176db57b8fbd9a52108.tar.gz
rails-0f5b32cd0804a3fe26027176db57b8fbd9a52108.tar.bz2
rails-0f5b32cd0804a3fe26027176db57b8fbd9a52108.zip
Merge pull request #5394 from erichmenge/master
retrieve_cache_key should work on objects that act like arrays.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/cache.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index d7408eff9f..b9f196d7a9 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -91,6 +91,7 @@ module ActiveSupport
case
when key.respond_to?(:cache_key) then key.cache_key
when key.is_a?(Array) then key.map { |element| retrieve_cache_key(element) }.to_param
+ when key.respond_to?(:to_a) then retrieve_cache_key(key.to_a)
else key.to_param
end.to_s
end