mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-07 16:03:37 +01:00
Prevent questions from being sent to banned users
This commit is contained in:
parent
9f9e290ac1
commit
68ca431165
1 changed files with 1 additions and 0 deletions
|
@ -12,6 +12,7 @@ class QuestionWorker
|
||||||
question = Question.find(question_id)
|
question = Question.find(question_id)
|
||||||
|
|
||||||
user.followers.each do |f|
|
user.followers.each do |f|
|
||||||
|
next if f.banned?
|
||||||
next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question }
|
next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question }
|
||||||
|
|
||||||
Inbox.create(user_id: f.id, question_id: question_id, new: true)
|
Inbox.create(user_id: f.id, question_id: question_id, new: true)
|
||||||
|
|
Loading…
Reference in a new issue