Commit 7ef5d0e4 by Mike Mangino Committed by Jon Yurek

Use the original filename to generate temp files

parent c3f194a5
......@@ -34,7 +34,7 @@ module Paperclip
private
def destination
@destination ||= TempfileFactory.new.generate
@destination ||= TempfileFactory.new.generate(@original_filename)
end
def copy_to_tempfile(src)
......
......@@ -56,4 +56,10 @@ describe Paperclip::AbstractAdapter do
it 'is not nil' do
assert !TestAdapter.new.nil?
end
should 'use the original filename to generate the tempfile' do
@adapter = TestAdapter.new
@adapter.original_filename = "file.png"
assert @adapter.send(:destination).path.ends_with?(".png")
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment