PERF: Speed up migrate_to_s3 rake task by deleting optimized image record.

PERF: Speed up migrate_to_s3 rake task by deleting optimized image record.

No point moving all optimized image files to tombstone when the store is changing. Also, destroy_all can easily blow memory since we are no loading in batches.

diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index 8fd1960..027351f 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -421,7 +421,7 @@ def migrate_to_s3
       OptimizedImage
         .joins("LEFT JOIN uploads u ON optimized_images.upload_id = u.id")
         .where("u.id IS NOT NULL AND u.url LIKE '//%' AND optimized_images.url NOT LIKE '//%'")
-        .destroy_all
+        .delete_all
 
       puts "Rebaking posts with lightboxes..."

GitHub sha: 2adbec1b