debian-mirror-gitlab/lib/carrier_wave_string_file.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
333 B
Ruby
Raw Normal View History

2018-12-13 13:39:08 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
class CarrierWaveStringFile < StringIO
def original_filename
""
end
2020-11-24 15:15:51 +05:30
def self.new_file(file_content:, filename:, content_type: "application/octet-stream")
{
"tempfile" => StringIO.new(file_content),
"filename" => filename,
"content_type" => content_type
}
end
2018-03-17 18:26:18 +05:30
end