class ActiveSupport::Cache::Store

def expanded_key(key)

called. If the key is a Hash, then keys will be sorted alphabetically.
object responds to +cache_key+. Otherwise, +to_param+ method will be
Expands key to be a consistent string value. Invokes +cache_key+ if
def expanded_key(key)
  return key.cache_key.to_s if key.respond_to?(:cache_key)
  case key
  when Array
    if key.size > 1
      key.collect { |element| expanded_key(element) }
    else
      expanded_key(key.first)
    end
  when Hash
    key.collect { |k, v| "#{k}=#{v}" }.sort!
  else
    key
  end.to_param
end