Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove unnecessary mv/unlink from Filesystem#flush_writes, complicate…

…s some failure modes
  • Loading branch information...
commit f8c244456d150c7b26440564feb085ce431d82c8 1 parent 772c8e9
@kreynolds kreynolds authored
View
7 lib/paperclip/storage/filesystem.rb
@@ -38,12 +38,7 @@ def flush_writes #:nodoc:
file.close
FileUtils.mkdir_p(File.dirname(path(style_name)))
log("saving #{path(style_name)}")
- begin
- FileUtils.mv(file.path, path(style_name))
- rescue SystemCallError
- FileUtils.cp(file.path, path(style_name))
- FileUtils.rm(file.path)
- end
+ FileUtils.cp(file.path, path(style_name))
FileUtils.chmod(0666&~File.umask, path(style_name))
end
View
2  test/integration_test.rb
@@ -81,8 +81,6 @@ class IntegrationTest < Test::Unit::TestCase
original.close
tf.rewind
- File.expects(:unlink).with(tf.instance_variable_get(:@tmpname))
-
@d2.avatar.expects(:to_file).with(:original).returns(tf)
@d2.avatar.reprocess!

0 comments on commit f8c2444

Please sign in to comment.
Something went wrong with that request. Please try again.