mirror of
https://ghfast.top/https://github.com/discourse/discourse-follow.git
synced 2026-07-15 11:36:38 +08:00
18 lines
426 B
Ruby
18 lines
426 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 post_item_excerpt_post
|
|
object
|
|
end
|
|
|
|
def category_id
|
|
object.topic.category_id
|
|
end
|
|
end
|