FEATURE: Anonymize User. A way to remove a user but keep their topics and posts.

This commit is contained in:
Neil Lalonde
2015-03-06 16:44:54 -05:00
parent a68512bebf
commit 608647d02f
16 changed files with 401 additions and 100 deletions

View File

@@ -0,0 +1,23 @@
class UsernameChanger
def initialize(user, new_username, actor=nil)
@user = user
@new_username = new_username
@actor = actor
end
def self.change(user, new_username, actor=nil)
self.new(user, new_username, actor).change
end
def change
if @actor && @actor != @user
StaffActionLogger.new(@actor).log_username_change(@user, @user.username, @new_username)
end
# future work: update mentions and quotes
@user.username = @new_username
@user.save
end
end