X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/6da536e5c8870cb30594a7397e074803080e2708..c5fc9f0e7e93088c599ae0d8540ee0117f277d6d:/lib/tasks/upgrade_avatars.rake diff --git a/lib/tasks/upgrade_avatars.rake b/lib/tasks/upgrade_avatars.rake index 03939dad8..0466609ff 100644 --- a/lib/tasks/upgrade_avatars.rake +++ b/lib/tasks/upgrade_avatars.rake @@ -1,6 +1,8 @@ namespace "storage" do task :upgrade_avatars => :environment do User.active.where.not(:image_file_name => nil).in_batches.each_record do |user| + next if user.avatar.attached? + io = File.open(user.image.path) filename = user.image.original_filename content_type = if user.image.content_type.nil?