2016-01-19 22:11:52 -06:00
|
|
|
class UserSummarySerializer < ApplicationSerializer
|
|
|
|
class TopicSerializer < BasicTopicSerializer
|
|
|
|
attributes :like_count, :slug, :created_at
|
|
|
|
end
|
|
|
|
|
|
|
|
class ReplySerializer < ApplicationSerializer
|
|
|
|
attributes :post_number, :like_count, :created_at
|
|
|
|
has_one :topic, serializer: TopicSerializer
|
|
|
|
end
|
|
|
|
|
|
|
|
has_many :topics, serializer: TopicSerializer
|
|
|
|
has_many :replies, serializer: ReplySerializer, embed: :object
|
|
|
|
has_many :badges, serializer: UserBadgeSerializer, embed: :object
|
|
|
|
|
|
|
|
attributes :likes_given, :likes_received, :posts_read_count,
|
|
|
|
:days_visited, :topic_count, :post_count
|
|
|
|
|
2016-03-29 01:11:47 -05:00
|
|
|
|
|
|
|
def include_badges?
|
|
|
|
SiteSetting.enable_badges
|
|
|
|
end
|
2016-01-19 22:11:52 -06:00
|
|
|
end
|