lib/dm-paperclip/upfile.rb in dm-paperclip-2.1.4 vs lib/dm-paperclip/upfile.rb in dm-paperclip-2.3.0
- old
+ new
@@ -26,11 +26,22 @@
# Returns the size of the file.
def size
File.size(self)
end
end
+end
+if defined? StringIO
+ class StringIO
+ attr_accessor :original_filename, :content_type
+ def original_filename
+ @original_filename ||= "stringio.txt"
+ end
+ def content_type
+ @content_type ||= "text/plain"
+ end
+ end
end
class File #:nodoc:
include Paperclip::Upfile
-end
+end
\ No newline at end of file