lib/active_support/cache.rb in activesupport-3.2.1 vs lib/active_support/cache.rb in activesupport-3.2.2.rc1
- old
+ new
@@ -75,12 +75,11 @@
end
def expand_cache_key(key, namespace = nil)
expanded_cache_key = namespace ? "#{namespace}/" : ""
- prefix = ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]
- if prefix
+ if prefix = ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]
expanded_cache_key << "#{prefix}/"
end
expanded_cache_key << retrieve_cache_key(key)
expanded_cache_key
@@ -89,10 +88,10 @@
private
def retrieve_cache_key(key)
case
when key.respond_to?(:cache_key) then key.cache_key
- when key.is_a?(Array) then ['Array', *key.map { |element| retrieve_cache_key(element) }].to_param
+ when key.is_a?(Array) then key.map { |element| retrieve_cache_key(element) }.to_param
else key.to_param
end.to_s
end
end