We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f307469 commit 7512b4eCopy full SHA for 7512b4e
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
+ 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