mirror of
https://github.com/discourse/discourse.git
synced 2025-04-28 12:34:35 +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
|
has_many :participants, serializer: TopicPosterSerializer, embed: :objects
|
||||||
|
|
||||||
def posters
|
def posters
|
||||||
object.posters || []
|
object.posters || object.posters_summary || []
|
||||||
end
|
end
|
||||||
|
|
||||||
def op_like_count
|
def op_like_count
|
||||||
|
@ -83,5 +83,15 @@ describe TopicListItemSerializer do
|
|||||||
|
|
||||||
expect(json[:tags]).to eq([])
|
expect(json[:tags]).to eq([])
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user