aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2017-06-10 11:01:43 -0700
committerJeremy Daer <jeremydaer@gmail.com>2017-06-10 11:04:34 -0700
commit816a3763d9bb070bf339de32c6a3ce31a45369f8 (patch)
tree2ae9cb2151b52120c3f1ed5e6c2a496b6f37f7cc /activesupport/lib
parenta625292c793cd1fffdcf7576ac860c259493b140 (diff)
downloadrails-816a3763d9bb070bf339de32c6a3ce31a45369f8.tar.gz
rails-816a3763d9bb070bf339de32c6a3ce31a45369f8.tar.bz2
rails-816a3763d9bb070bf339de32c6a3ce31a45369f8.zip
Revert #25628. Incomplete change + needs a deprecation cycle.
See https://github.com/rails/rails/issues/29067#issuecomment-301342084 for rationale. This reverts commit b76f82d714e590c20370e72fa36fa574c4f17650. Fixes #29067. Fixes #29081.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/cache.rb2
-rw-r--r--activesupport/lib/active_support/cache/file_store.rb2
-rw-r--r--activesupport/lib/active_support/cache/strategy/local_cache.rb6
3 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb
index fa487060e2..3847d8b7ae 100644
--- a/activesupport/lib/active_support/cache.rb
+++ b/activesupport/lib/active_support/cache.rb
@@ -499,7 +499,7 @@ module ActiveSupport
# The options hash is passed to the underlying cache implementation.
#
# All implementations may not support this method.
- def clear
+ def clear(options = nil)
raise NotImplementedError.new("#{self.class.name} does not support clear")
end
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index d5c8585816..945f50a56e 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -27,7 +27,7 @@ module ActiveSupport
# Deletes all items from the cache. In this case it deletes all the entries in the specified
# file store directory except for .keep or .gitkeep. Be careful which directory is specified in your
# config file when using +FileStore+ because everything in that directory will be deleted.
- def clear
+ def clear(options = nil)
root_dirs = exclude_from(cache_path, EXCLUDED_DIRS + GITKEEP_FILES)
FileUtils.rm_r(root_dirs.collect { |f| File.join(cache_path, f) })
rescue Errno::ENOENT
diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb
index 91875a56f5..0e4f383fb9 100644
--- a/activesupport/lib/active_support/cache/strategy/local_cache.rb
+++ b/activesupport/lib/active_support/cache/strategy/local_cache.rb
@@ -44,7 +44,7 @@ module ActiveSupport
yield
end
- def clear
+ def clear(options = nil)
@data.clear
end
@@ -79,9 +79,9 @@ module ActiveSupport
local_cache_key)
end
- def clear # :nodoc:
+ def clear(options = nil) # :nodoc:
return super unless cache = local_cache
- cache.clear
+ cache.clear(options)
super
end