From 3424bd83d699bb996aa27d85b970e484d37e3485 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 20 Sep 2018 20:40:31 -0500 Subject: Switch to supports_cache_versioning? check to a class method - Moving the `supports_cache_versioning?` check to a class method. - Shorten the method doc. - Expand on the error message. --- activesupport/lib/active_support/cache/file_store.rb | 6 ++---- activesupport/lib/active_support/cache/mem_cache_store.rb | 6 ++---- activesupport/lib/active_support/cache/memory_store.rb | 6 ++---- activesupport/lib/active_support/cache/null_store.rb | 6 ++---- activesupport/lib/active_support/cache/redis_cache_store.rb | 6 ++---- 5 files changed, 10 insertions(+), 20 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index b17f0a4a4a..53a2b07536 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -26,10 +26,8 @@ module ActiveSupport @cache_path = cache_path.to_s end - # Advertise that this cache store can be used - # with "recyclable cache keys" otherwise known - # as cache versioning. - def supports_in_cache_versioning? + # Advertise cache versioning support. + def self.supports_cache_versioning? true end diff --git a/activesupport/lib/active_support/cache/mem_cache_store.rb b/activesupport/lib/active_support/cache/mem_cache_store.rb index f235f05d6c..174c784deb 100644 --- a/activesupport/lib/active_support/cache/mem_cache_store.rb +++ b/activesupport/lib/active_support/cache/mem_cache_store.rb @@ -47,10 +47,8 @@ module ActiveSupport end end - # Advertise that this cache store can be used - # with "recyclable cache keys" otherwise known - # as cache versioning. - def supports_in_cache_versioning? + # Advertise cache versioning support. + def self.supports_cache_versioning? true end diff --git a/activesupport/lib/active_support/cache/memory_store.rb b/activesupport/lib/active_support/cache/memory_store.rb index 32530fa2a9..106b616529 100644 --- a/activesupport/lib/active_support/cache/memory_store.rb +++ b/activesupport/lib/active_support/cache/memory_store.rb @@ -30,10 +30,8 @@ module ActiveSupport @pruning = false end - # Advertise that this cache store can be used - # with "recyclable cache keys" otherwise known - # as cache versioning. - def supports_in_cache_versioning? + # Advertise cache versioning support. + def self.supports_cache_versioning? true end diff --git a/activesupport/lib/active_support/cache/null_store.rb b/activesupport/lib/active_support/cache/null_store.rb index 405d485671..8452a28fd8 100644 --- a/activesupport/lib/active_support/cache/null_store.rb +++ b/activesupport/lib/active_support/cache/null_store.rb @@ -12,10 +12,8 @@ module ActiveSupport class NullStore < Store prepend Strategy::LocalCache - # Advertise that this cache store can be used - # with "recyclable cache keys" otherwise known - # as cache versioning. - def supports_in_cache_versioning? + # Advertise cache versioning support. + def self.supports_cache_versioning? true end diff --git a/activesupport/lib/active_support/cache/redis_cache_store.rb b/activesupport/lib/active_support/cache/redis_cache_store.rb index 4cee774908..9a55e49e27 100644 --- a/activesupport/lib/active_support/cache/redis_cache_store.rb +++ b/activesupport/lib/active_support/cache/redis_cache_store.rb @@ -66,10 +66,8 @@ module ActiveSupport SCAN_BATCH_SIZE = 1000 private_constant :SCAN_BATCH_SIZE - # Advertise that this cache store can be used - # with "recyclable cache keys" otherwise known - # as cache versioning. - def supports_in_cache_versioning? + # Advertise cache versioning support. + def self.supports_cache_versioning? true end -- cgit v1.2.3