diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-10-28 19:09:22 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-10-28 19:09:22 -0200 |
commit | f18cf8e4884529f28d19f118abd0b46c99bd8cfa (patch) | |
tree | da0bdb7f4888b51cac17e3d31029c71ff52b5797 /activesupport/lib/active_support/cache | |
parent | f78c5fbb96b507fb80405c25cfce12136f9d45cd (diff) | |
parent | c17bd7476abb0bade3c27e652b1d56548d0ee4ae (diff) | |
download | rails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.tar.gz rails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.tar.bz2 rails-f18cf8e4884529f28d19f118abd0b46c99bd8cfa.zip |
Merge pull request #11785 from grosser/grosser/file-unless-exist
support :unless_exist for FileCache
Conflicts:
activesupport/CHANGELOG.md
activesupport/test/caching_test.rb
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r-- | activesupport/lib/active_support/cache/file_store.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index 10d39463ec..5cd6065077 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -97,6 +97,7 @@ module ActiveSupport def write_entry(key, entry, options) file_name = key_file_path(key) + return false if options[:unless_exist] && File.exist?(file_name) ensure_cache_path(File.dirname(file_name)) File.atomic_write(file_name, cache_path) {|f| Marshal.dump(entry, f)} true |