diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-17 02:55:58 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2016-08-17 02:55:58 -0300 |
commit | 32e25e812df3a6bda577a835b38aed80c5253bad (patch) | |
tree | 718089bc8fc3668719fe14c759eeaa74b60705aa /activesupport/lib | |
parent | ae739edf4c5fba322e0ba6309b80a08a158b23c4 (diff) | |
parent | b76f82d714e590c20370e72fa36fa574c4f17650 (diff) | |
download | rails-32e25e812df3a6bda577a835b38aed80c5253bad.tar.gz rails-32e25e812df3a6bda577a835b38aed80c5253bad.tar.bz2 rails-32e25e812df3a6bda577a835b38aed80c5253bad.zip |
Merge pull request #25628 from ysksn/options
Remove parameter "options = nil" for #clear
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/cache.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/cache/file_store.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/cache/strategy/local_cache.rb | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/cache.rb b/activesupport/lib/active_support/cache.rb index b0d371d91e..8ef91fa3f0 100644 --- a/activesupport/lib/active_support/cache.rb +++ b/activesupport/lib/active_support/cache.rb @@ -464,7 +464,7 @@ module ActiveSupport # 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 diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index 297c913034..1971ff182e 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(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 diff --git a/activesupport/lib/active_support/cache/strategy/local_cache.rb b/activesupport/lib/active_support/cache/strategy/local_cache.rb index fbc28fedb1..ec2e96a106 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(options = nil) + def clear @data.clear end @@ -78,9 +78,9 @@ module ActiveSupport 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 |