mainio/decidim-module-term_customizer

Memcached throws NoMethodError in `clear_cache`

Closed this issue · 2 comments

The method Decidim::TermCustomizer::Loader#clear_cache uses the Rails.cache.delete_matched method to avoid rebuilding the whole cache when applying translations.

Rails.cache.delete_matched("#{cache_key_base}/*")

But this method is not supported by all cache implementations. Then the Loader class controls this situation implementing a rescue NotImplementedError. The problem is that Memcached's dally adapter raises a NoMethodError instead, this causes the application to crash when the user clears term-customizer's cache.

There are a few fixes as mentioned here: refinery/refinerycms#2130 (comment)
I implement one of the fixes on this PR: #31

Fixed by #31