discourse-follow/app/serializers/follow_post_serializer.rb
Osama Sayegh 902e770115 FEATURE: Introduce followed users posts feed (#8)
This commit adds a nav item under the Activity tab in user profile to show a feed of posts made by followed users.
2021-10-07 20:34:07 +03:00

22 lines
411 B
Ruby

# frozen_string_literal: true
class FollowPostSerializer < ApplicationSerializer
include PostItemExcerpt
attributes *%i(
category_id
created_at
id
post_number
post_type
topic_id
url
)
has_one :user, serializer: BasicUserSerializer, embed: :object
has_one :topic, serializer: BasicTopicSerializer, embed: :object
def category_id
object.topic.category_id
end
end