Skip to content

Instantly share code, notes, and snippets.

@3014zhangshuo
Created January 15, 2019 08:08
Show Gist options
  • Save 3014zhangshuo/0dc966da467b75a86a264b15794e19ef to your computer and use it in GitHub Desktop.
Save 3014zhangshuo/0dc966da467b75a86a264b15794e19ef to your computer and use it in GitHub Desktop.
FileIO: Writing strings as Carrierwave uploads
class FileIO < StringIO
def initialize(stream, filename)
super(stream)
@original_filename = filename
end
attr_reader :original_filename
end
# https://makandracards.com/makandra/50526-fileio-writing-strings-as-carrierwave-uploads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment