1
0
mirror of https://github.com/whippyshou/mastodon synced 2024-12-01 08:18:48 +09:00

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.
This commit is contained in:
ThibG 2020-11-01 06:34:43 +01:00 committed by GitHub
parent f1f0400adc
commit c49805efb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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