mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:37:55 +08:00
24 lines
474 B
Ruby
24 lines
474 B
Ruby
class GroupPostSerializer < ApplicationSerializer
|
|
attributes :id,
|
|
:excerpt,
|
|
:created_at,
|
|
:title,
|
|
:url,
|
|
:category
|
|
|
|
has_one :user, serializer: BasicUserSerializer, embed: :object
|
|
has_one :topic, serializer: BasicTopicSerializer, embed: :object
|
|
|
|
def title
|
|
object.topic.title
|
|
end
|
|
|
|
def include_user_long_name?
|
|
SiteSetting.enable_names?
|
|
end
|
|
|
|
def category
|
|
object.topic.category
|
|
end
|
|
end
|