discourse/plugins/chat/app/jobs/regular/delete_user_messages.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
286 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Jobs
class DeleteUserMessages < ::Jobs::Base
def execute(args)
return if args[:user_id].nil?
ChatMessageDestroyer.new.destroy_in_batches(
ChatMessage.with_deleted.where(user_id: args[:user_id]),
)
end
end
end