mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 04:56:18 +08:00
FIX: composer problem on the categories page (#9508)
This commit is contained in:
parent
04fb37c7a4
commit
81c216e04c
|
@ -21,7 +21,7 @@ class TopicListItemSerializer < ListableTopicSerializer
|
|||
has_many :participants, serializer: TopicPosterSerializer, embed: :objects
|
||||
|
||||
def posters
|
||||
object.posters || []
|
||||
object.posters || object.posters_summary || []
|
||||
end
|
||||
|
||||
def op_like_count
|
||||
|
|
|
@ -83,5 +83,15 @@ describe TopicListItemSerializer do
|
|||
|
||||
expect(json[:tags]).to eq([])
|
||||
end
|
||||
|
||||
it 'return posters' do
|
||||
json = TopicListItemSerializer.new(topic,
|
||||
scope: Guardian.new(user),
|
||||
hidden_tag_names: [hidden_tag.name],
|
||||
root: false
|
||||
).as_json
|
||||
|
||||
expect(json[:posters].length).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user