From a26889ada2873ea8d128447cc2169bdaca568b9e Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 8 Jun 2018 15:24:15 +0200 Subject: [PATCH] FIX: Don't delete profile views during user anonymization There's no need for that and it can take a lot of time. --- app/services/user_anonymizer.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/services/user_anonymizer.rb b/app/services/user_anonymizer.rb index 35e77ea88d..9e9d8667e3 100644 --- a/app/services/user_anonymizer.rb +++ b/app/services/user_anonymizer.rb @@ -47,9 +47,10 @@ class UserAnonymizer options.email_direct = false options.save - profile = @user.user_profile - profile.destroy if profile - @user.create_user_profile + if profile = @user.user_profile + profile.update(location: nil, website: nil, bio_raw: nil, bio_cooked: nil, + profile_background: nil, card_background: nil) + end @user.user_avatar.try(:destroy) @user.twitter_user_info.try(:destroy)