mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 08:02:05 +08:00
FIX: properly secure poll message bus
Co-authored-by: Sam <sam.saffron@gmail.com>
This commit is contained in:
@ -91,7 +91,7 @@ module DiscoursePoll
|
||||
if has_changed
|
||||
polls = ::Poll.includes(poll_options: :poll_votes).where(post: post)
|
||||
polls = ActiveModel::ArraySerializer.new(polls, each_serializer: PollSerializer, root: false).as_json
|
||||
MessageBus.publish("/polls/#{post.topic_id}", post_id: post.id, polls: polls)
|
||||
post.publish_message!("/polls/#{post.topic_id}", post_id: post.id, polls: polls)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user