mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: preload poll voters
This commit is contained in:
@@ -9,7 +9,8 @@ class PollSerializer < ApplicationSerializer
|
||||
:step,
|
||||
:options,
|
||||
:voters,
|
||||
:close
|
||||
:close,
|
||||
:preloaded_voters
|
||||
|
||||
def public
|
||||
true
|
||||
@@ -47,4 +48,12 @@ class PollSerializer < ApplicationSerializer
|
||||
object.close_at.present?
|
||||
end
|
||||
|
||||
def preloaded_voters
|
||||
DiscoursePoll::Poll.serialized_voters(object)
|
||||
end
|
||||
|
||||
def include_preloaded_voters?
|
||||
object.can_see_voters?(scope)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user