class method
self.expand_cache_key
Ruby on Rails 2.3.18
Since v2.2.3Signature
self.expand_cache_key(key, namespace = nil)
No documentation comment.
Parameters
-
keyreq -
namespaceopt = nil
Source
# File activesupport/lib/active_support/cache.rb, line 57
def self.expand_cache_key(key, namespace = nil)
expanded_cache_key = namespace ? "#{namespace}/" : ""
if ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]
expanded_cache_key << "#{ENV["RAILS_CACHE_ID"] || ENV["RAILS_APP_VERSION"]}/"
end
expanded_cache_key << case
when key.respond_to?(:cache_key)
key.cache_key
when key.is_a?(Array)
key.collect { |element| expand_cache_key(element) }.to_param
when key
key.to_param
end.to_s
expanded_cache_key
end
Defined in activesupport/lib/active_support/cache.rb line 57
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache