Merge pull request #85 from insales/rewind_files

Делаем rewind файлам перед чтением
This commit is contained in:
Nastia
2022-12-12 14:24:01 +03:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -276,7 +276,9 @@ module Paperclip
end
def to_file(style = default_style)
queued_for_write[style]
file = queued_for_write[style]
file&.rewind
file
end
def to_io(*args)

View File

@@ -234,6 +234,7 @@ module Paperclip
}.merge(self.class.upload_options)
files.each do |style, file|
path = key(style)
file.rewind
log "Saving to #{store_id}:#{path}"
store.put_object(common_options.merge(key: path, body: file))
end