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