Fix poll ending notifications being created for each vote (#15071)

On a poll ending, notifications were created for each vote instead
of for each voter.
lolsob-rspec
ThibG 2020-11-01 06:34:43 +01:00 committed by GitHub
parent a0b695b0c6
commit 2b0491bb3c
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ class PollExpirationNotifyWorker
end
# Notify local voters
poll.votes.includes(:account).map(&:account).select(&:local?).each do |account|
poll.votes.includes(:account).group(:account_id).select(:account_id).map(&:account).select(&:local?).each do |account|
NotifyService.new.call(account, :poll, poll)
end
rescue ActiveRecord::RecordNotFound