mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
workaround badly denormalized data in polls
This commit is contained in:
@@ -280,7 +280,8 @@ after_initialize do
|
||||
User.where(id: user_ids).each do |user|
|
||||
user_hash = UserNameSerializer.new(user).serializable_hash
|
||||
|
||||
poll_votes[user.id.to_s][poll_name].each do |option_id|
|
||||
# protect against poorly denormalized data
|
||||
poll_votes.dig(user.id.to_s, poll_name)&.each do |option_id|
|
||||
if (params[:option_id])
|
||||
next unless option_id == params[:option_id].to_s
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user