Skip to content

Commit 260aeef

Browse files
committed
Merge branch 'develop'
2 parents 1a8a2e6 + 7512b4e commit 260aeef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/tasks/cortex.rake

+3-1
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@ namespace :cortex do
221221
object_key = media.attachment.arbitrary_url_for args[:old_path]
222222

223223
begin
224-
image = s3.get_object({bucket: ENV['S3_BUCKET_NAME'], key: object_key})
224+
previous_filename = media.attachment_file_name
225+
image = s3.get_object({bucket: ENV['S3_BUCKET_NAME'], key: object_key}).body
225226
puts "Re-saving image attachment #{media.id} - #{media.attachment_file_name}"
226227
media.attachment = image
228+
media.attachment_file_name = previous_filename
227229
media.save
228230
# if there are multiple styles (thumbnail, etc), recreate them:
229231
media.attachment.reprocess!

0 commit comments

Comments
 (0)