Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added original_filename and content_type accessors to StringIO

  • Loading branch information...
commit d92be0d894545a447728186e5f7141f32adcb883 1 parent 0a1187e
@jyurek jyurek authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/paperclip/upfile.rb
View
11 lib/paperclip/upfile.rb
@@ -28,7 +28,18 @@ 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:

1 comment on commit d92be0d

@hadees

How are you supposed to access the new StringIO methods? everything i've tired and i keep getting undefined method `content_type=' for #StringIO:0x2b8e47f4d638

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