未验证 提交 32e25e81 编写于 作者: R Rafael Mendonça França

Merge pull request #25628 from ysksn/options

Remove parameter "options = nil" for #clear
* Remove unused parameter `options = nil` for `#clear` of
`ActiveSupport::Cache::Strategy::LocalCache::LocalStore` and
`ActiveSupport::Cache::Strategy::LocalCache`.
*Yosuke Kabuto*
* Fix `thread_mattr_accessor` subclass no longer overwrites parent.
Assigning a value to a subclass using `thread_mattr_accessor` no
......
......@@ -464,7 +464,7 @@ def cleanup(options = nil)
# The options hash is passed to the underlying cache implementation.
#
# All implementations may not support this method.
def clear(options = nil)
def clear
raise NotImplementedError.new("#{self.class.name} does not support clear")
end
......
......@@ -27,7 +27,7 @@ def initialize(cache_path, options = nil)
# 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(options = nil)
def clear
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
......
......@@ -44,7 +44,7 @@ def synchronize # :nodoc:
yield
end
def clear(options = nil)
def clear
@data.clear
end
......@@ -78,9 +78,9 @@ def middleware
local_cache_key)
end
def clear(options = nil) # :nodoc:
def clear # :nodoc:
return super unless cache = local_cache
cache.clear(options)
cache.clear
super
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册