diff options
author | Erich Menge <erich.menge@me.com> | 2012-03-11 23:21:37 -0500 |
---|---|---|
committer | Erich Menge <erich.menge@me.com> | 2012-03-12 12:29:30 -0500 |
commit | be623677a3b05696e70518072576588cbeaf83cd (patch) | |
tree | 68fddc34e037dce6fa00808a0760e00d0ef63fcb /activesupport/lib | |
parent | 6c0d5a19a4e97be3d004997f6547ec19e6a22363 (diff) | |
download | rails-be623677a3b05696e70518072576588cbeaf83cd.tar.gz rails-be623677a3b05696e70518072576588cbeaf83cd.tar.bz2 rails-be623677a3b05696e70518072576588cbeaf83cd.zip |
Allow retrieve_cache_key to work on collections such as ActiveRecord::Relation.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 1 |
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 |