From 68ca431165f3bdde3e60baedf8029bda6c063d97 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 12 Nov 2022 11:58:20 +0100 Subject: [PATCH] Prevent questions from being sent to banned users --- app/workers/question_worker.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/workers/question_worker.rb b/app/workers/question_worker.rb index 0416244a..8f7823a6 100644 --- a/app/workers/question_worker.rb +++ b/app/workers/question_worker.rb @@ -12,6 +12,7 @@ class QuestionWorker question = Question.find(question_id) user.followers.each do |f| + next if f.banned? next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question } Inbox.create(user_id: f.id, question_id: question_id, new: true)