Fix 'redis is not part of the bundle' exception when using :memory_store

When RedisCacheStore constant is referenced, activesupport autoloads and
rails tries to require redis, throwing exception if not present
This commit is contained in:
Gonzalo Rodriguez 2018-06-22 19:10:35 -03:00
parent e3213ee746
commit ee84079768
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1

View file

@ -5,7 +5,7 @@ module Rack
module StoreProxy
class RedisCacheStoreProxy < SimpleDelegator
def self.handle?(store)
defined?(::ActiveSupport::Cache::RedisCacheStore) && store.is_a?(::ActiveSupport::Cache::RedisCacheStore)
defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisCacheStore) && store.is_a?(::ActiveSupport::Cache::RedisCacheStore)
end
def increment(name, amount = 1, options = {})