Prevent questions from being sent to banned users

This commit is contained in:
Karina Kwiatek 2022-11-12 11:58:20 +01:00
parent 9f9e290ac1
commit 68ca431165
1 changed files with 1 additions and 0 deletions

View File

@ -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)