diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake index e50e098e59a..4a882b1d844 100644 --- a/lib/tasks/uploads.rake +++ b/lib/tasks/uploads.rake @@ -12,7 +12,9 @@ task "uploads:gather" => :environment do puts "", "Gathering uploads for '#{current_db}'...", "" - Upload.where("url !~ '^\/uploads\/#{current_db}'").find_each do |upload| + Upload.where("url ~ '^\/uploads\/'") + .where("url !~ '^\/uploads\/#{current_db}'") + .find_each do |upload| begin old_db = upload.url[/^\/uploads\/([^\/]+)\//, 1] from = upload.url.dup