gitlab-org--gitlab-foss/app/models/spam_log.rb
Stan Hu fd60561936 Use DeleteUserWorker for removing users via spam logs
Before deleting a user via a SpamLog would just call `user.destroy`,
which may omit other things that need to be cleaned up.
2017-04-17 17:17:31 -07:00

14 lines
310 B
Ruby

class SpamLog < ActiveRecord::Base
belongs_to :user
validates :user, presence: true
def remove_user(deleted_by:)
user.block
DeleteUserWorker.perform_async(deleted_by.id, user.id, delete_solo_owned_groups: true, hard_delete: true)
end
def text
[title, description].join("\n")
end
end