A platform for community discussion. Free, open, simple.
FIX: composer problem on the categories page (#9508)
Krzysztof Kotlarek81c216e04c13
diff --git a/app/serializers/topic_list_item_serializer.rb b/app/serializers/topic_list_item_serializer.rbindex 7962c400c03..d0cff44cb8f 100644--- a/app/serializers/topic_list_item_serializer.rb+++ b/app/serializers/topic_list_item_serializer.rb@@ -21,7 +21,7 @@ class TopicListItemSerializer < ListableTopicSerializerhas_many :participants, serializer: TopicPosterSerializer, embed: :objectsdef posters- object.posters || []+ object.posters || object.posters_summary || []enddef op_like_countdiff --git a/spec/serializers/topic_list_item_serializer_spec.rb b/spec/serializers/topic_list_item_serializer_spec.rbindex 1ca54ef3117..72acb82aef4 100644--- a/spec/serializers/topic_list_item_serializer_spec.rb+++ b/spec/serializers/topic_list_item_serializer_spec.rb@@ -83,5 +83,15 @@ describe TopicListItemSerializer doexpect(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)+ endendend