summaryrefslogtreecommitdiff
path: root/lib/carrier_wave_string_file.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/carrier_wave_string_file.rb')
-rw-r--r--lib/carrier_wave_string_file.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/carrier_wave_string_file.rb b/lib/carrier_wave_string_file.rb
index c9a64d9e631..b6bc3d986ca 100644
--- a/lib/carrier_wave_string_file.rb
+++ b/lib/carrier_wave_string_file.rb
@@ -4,4 +4,12 @@ class CarrierWaveStringFile < StringIO
def original_filename
""
end
+
+ def self.new_file(file_content:, filename:, content_type: "application/octet-stream")
+ {
+ "tempfile" => StringIO.new(file_content),
+ "filename" => filename,
+ "content_type" => content_type
+ }
+ end
end