module ActiveSupport::Cache

def expand_cache_key(key, namespace = nil)

The +key+ argument can also respond to +cache_key+ or +to_param+.

ActiveSupport::Cache.expand_cache_key([:foo, :bar], "namespace") # => "namespace/foo/bar"
ActiveSupport::Cache.expand_cache_key([:foo, :bar]) # => "foo/bar"

concatenated into a single key. For example:
each of elements in the array will be turned into parameters/keys and
If the +key+ argument provided is an array, or responds to +to_a+, then

scoped within that namespace.
cache store. Optionally accepts a namespace, and all keys will be
Expands out the +key+ argument into a key that can be used for the
def expand_cache_key(key, namespace = nil)
  expanded_cache_key = namespace ? +"#{namespace}/" : +""
  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
end