summaryrefslogtreecommitdiff
path: root/app/services/users/destroy_service.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2017-04-06 22:33:07 +0530
committerTimothy Andrew <mail@timothyandrew.net>2017-04-06 22:39:40 +0530
commit1c42505b026d922df50c59d5f9e85073b5f5345f (patch)
treeb94259c6aa9c4a6e2e24d00d91c4d548a7bd6953 /app/services/users/destroy_service.rb
parente152f3f3daf09b25e5a5952a0e62580b3ef96c50 (diff)
downloadgitlab-ce-1c42505b026d922df50c59d5f9e85073b5f5345f.tar.gz
Implement review comments from @DouweM for !10467.28695-move-all-associated-records-to-ghost-user
1. Have `MigrateToGhostUser` be a service rather than a mixed-in module, to keep things explicit. Specs testing the behavior of this class are moved into a separate service spec file. 2. Add a `user.reported_abuse_reports` association to make the `migrate_abuse_reports` method more consistent with the other `migrate_` methods.
Diffstat (limited to 'app/services/users/destroy_service.rb')
-rw-r--r--app/services/users/destroy_service.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb
index e6608e316dc..ba58b174cc0 100644
--- a/app/services/users/destroy_service.rb
+++ b/app/services/users/destroy_service.rb
@@ -1,7 +1,5 @@
module Users
class DestroyService
- include MigrateToGhostUser
-
attr_accessor :current_user
def initialize(current_user)
@@ -28,7 +26,7 @@ module Users
::Projects::DestroyService.new(project, current_user, skip_repo: true).execute
end
- move_associated_records_to_ghost_user(user)
+ MigrateToGhostUserService.new(user).execute
# Destroy the namespace after destroying the user since certain methods may depend on the namespace existing
namespace = user.namespace