module Switchman::ActiveSupport::Cache::ClassMethods

Public Instance Methods

lookup_store(*store_options) click to toggle source
Calls superclass method
# File lib/switchman/active_support/cache.rb, line 7
def lookup_store(*store_options)
  store = super
  # can't use defined?, because it's a _ruby_ autoloaded constant,
  # so just checking that will cause it to get required
  ::ActiveSupport::Cache::RedisCacheStore.prepend(RedisCacheStore) if store.instance_of?(ActiveSupport::Cache::RedisCacheStore) && !::ActiveSupport::Cache::RedisCacheStore.ancestors.include?(RedisCacheStore)
  store.options[:namespace] ||= -> { Shard.current.default? ? nil : "shard_#{Shard.current.id}" }
  store
end