Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor StoreProxy to avoid autoloading MemCacheStore
In v4.4.0, checking `defined?(ActiveSupport::Cache::MemCacheStore)` could trigger an error loading dalli, which isn’t needed. This fixes that bug, and prevents similar bugs by checking `store.class.to_s` rather than `defined?(klass) && store.is_a?(klass)`. Writing an automated test to ensure that dalli is truly optional is difficult, but I was able to recreate the dalli load error in v4.4.0 by running: gem uninstall dalli ruby -Ilib -ractive_support/all -ractive_support/cache/redis_store -rrack/attack -e 'p Rack::Attack::StoreProxy.build(Redis::Store.new)' Fixes #163
- Loading branch information