We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1a8a2e6 + 7512b4e commit 260aeefCopy full SHA for 260aeef
lib/tasks/cortex.rake
@@ -221,9 +221,11 @@ namespace :cortex do
221
object_key = media.attachment.arbitrary_url_for args[:old_path]
222
223
begin
224
- image = s3.get_object({bucket: ENV['S3_BUCKET_NAME'], key: object_key})
+ previous_filename = media.attachment_file_name
225
+ image = s3.get_object({bucket: ENV['S3_BUCKET_NAME'], key: object_key}).body
226
puts "Re-saving image attachment #{media.id} - #{media.attachment_file_name}"
227
media.attachment = image
228
+ media.attachment_file_name = previous_filename
229
media.save
230
# if there are multiple styles (thumbnail, etc), recreate them:
231
media.attachment.reprocess!
0 commit comments