Permalink
Browse files

Ensure file atomic write uses the cache directory as its tmp folder

  • Loading branch information...
josh committed Aug 6, 2008
1 parent 165120a commit c6b7d0f34472ee7ef03d602c8923fd0ba8dab833
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/cache/file_store.rb
@@ -15,7 +15,7 @@ def read(name, options = nil)
def write(name, value, options = nil)
super
ensure_cache_path(File.dirname(real_file_path(name)))
- File.atomic_write(real_file_path(name)) { |f| f.write(value) }
+ File.atomic_write(real_file_path(name), cache_path) { |f| f.write(value) }
rescue => e
RAILS_DEFAULT_LOGGER.error "Couldn't create cache directory: #{name} (#{e.message})" if RAILS_DEFAULT_LOGGER
end

0 comments on commit c6b7d0f

Please sign in to comment.