I used paperclip to upload images to S3,
has_attached_file :attachment,
styles: { mini: '48x48>', small: '100x100>', product: '240x240>', large: '600x600>',larger: '860x1280>' },
default_style: :product
validates_attachment :attachment,
:presence => true,
:content_type => { :content_type => %w(image/jpeg image/jpg image/png image/gif) }
Now , I want to compress the images which are already uploaded to S3 using gem "paperclip-compression", so I added processors: [:thumbnail, :compression],
How would I update all the attachments using a ruby script??. I am able to read and store image into file but unable to update the attachment with the file.