aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/cache.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index f23f6f16d6..a627fa8651 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -511,7 +511,7 @@ module ActiveSupport
# called. If the key is a Hash, then keys will be sorted alphabetically.
def expanded_key(key) # :nodoc:
return key.cache_key.to_s if key.respond_to?(:cache_key)
- trailing_slash = false
+
case key
when Array
if key.size > 1
@@ -519,12 +519,11 @@ module ActiveSupport
else
key = key.first
end
- trailing_slash = true
when Hash
key = key.sort_by { |k,_| k.to_s }.collect{|k,v| "#{k}=#{v}"}
end
- key = key.to_param
- trailing_slash ? "#{key}/" : key
+
+ key.to_param
end
# Prefix a key with the namespace. Namespace and key will be delimited