X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/b911b45961165d64fba577d4cb87740d89ec6784..3cfffc2258621558e1147ceaf63980a7f6ed414b:/lib/tasks/upgrade_avatars.rake diff --git a/lib/tasks/upgrade_avatars.rake b/lib/tasks/upgrade_avatars.rake deleted file mode 100644 index 0466609ff..000000000 --- a/lib/tasks/upgrade_avatars.rake +++ /dev/null @@ -1,17 +0,0 @@ -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? - MimeMagic.by_magic(io)&.type - else - user.image.content_type - end - - user.avatar.attach(:io => io, :filename => filename, :content_type => content_type) - end - end -end