diff options
author | schneems <richard.schneeman+foo@gmail.com> | 2018-09-20 20:40:31 -0500 |
---|---|---|
committer | schneems <richard.schneeman+foo@gmail.com> | 2018-09-20 20:40:31 -0500 |
commit | 3424bd83d699bb996aa27d85b970e484d37e3485 (patch) | |
tree | dcef5ad547631c8680763cd57479259d2ddc75ed /activesupport/lib | |
parent | 135d3e15b72b9820212027b057df8980140a947b (diff) | |
download | rails-3424bd83d699bb996aa27d85b970e484d37e3485.tar.gz rails-3424bd83d699bb996aa27d85b970e484d37e3485.tar.bz2 rails-3424bd83d699bb996aa27d85b970e484d37e3485.zip |
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.
Diffstat (limited to 'activesupport/lib')
5 files changed, 10 insertions, 20 deletions
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 |