lib/dm-paperclip-r3/iostream.rb in dm-paperclip-r3-2.4.4 vs lib/dm-paperclip-r3/iostream.rb in dm-paperclip-r3-2.4.5
- old
+ new
@@ -4,10 +4,10 @@
# Returns a Tempfile containing the contents of the readable object.
def to_tempfile(object)
return object.to_tempfile if object.respond_to?(:to_tempfile)
name = object.respond_to?(:original_filename) ? object.original_filename : (object.respond_to?(:path) ? object.path : "stream")
- tempfile = Paperclip::Tempfile.new(["stream", File.extname(name)])
+ tempfile = Tempfile.new(File.basename(name))
tempfile.binmode
stream_to(object, tempfile)
end
# Copies one read-able object from one place to another in blocks, obviating the need to load