Module: Switchman::ActiveSupport::Cache::ClassMethods
- Defined in:
- lib/switchman/active_support/cache.rb
Instance Method Summary collapse
Instance Method Details
#lookup_store(*store_options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/switchman/active_support/cache.rb', line 7 def lookup_store(*) store = super # can't use defined?, because it's a _ruby_ autoloaded constant, # so just checking that will cause it to get required if store.class.name == "ActiveSupport::Cache::RedisCacheStore" && !::ActiveSupport::Cache::RedisCacheStore.ancestors.include?(RedisCacheStore) ::ActiveSupport::Cache::RedisCacheStore.prepend(RedisCacheStore) end store.[:namespace] ||= lambda { Shard.current.default? ? nil : "shard_#{Shard.current.id}" } store end |