Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-21 18:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-21 18:10:03 +0300
commitd5098d9fe3a5f05d9b90996851ab753f8b40cf65 (patch)
tree6f909667e89a3ad70e10c39b48fc417459b759fd /lib/carrier_wave_string_file.rb
parent4ea7a80898d3266d386ca928d7c253d4bf588e1c (diff)
Add latest changes from gitlab-org/gitlab@master
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