aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2008-08-06 17:22:58 -0500
committerJoshua Peek <josh@joshpeek.com>2008-08-06 17:25:32 -0500
commitc6b7d0f34472ee7ef03d602c8923fd0ba8dab833 (patch)
treea3ab0c7716f259182268ee69038b7009f55c13f5 /activesupport
parent165120a606577dd81fe1a267899c4415fe25f1fb (diff)
downloadrails-c6b7d0f34472ee7ef03d602c8923fd0ba8dab833.tar.gz
rails-c6b7d0f34472ee7ef03d602c8923fd0ba8dab833.tar.bz2
rails-c6b7d0f34472ee7ef03d602c8923fd0ba8dab833.zip
Ensure file atomic write uses the cache directory as its tmp folder
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/cache/file_store.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb
index 0bdca49388..7b6ca39091 100644
--- a/activesupport/lib/active_support/cache/file_store.rb
+++ b/activesupport/lib/active_support/cache/file_store.rb
@@ -15,7 +15,7 @@ module ActiveSupport
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