FEATURE: Add category_id to TopicViewWordpressSerializer (#10372)

This commit is contained in:
Simon Cossar 2020-08-04 18:50:15 -07:00 committed by GitHub
parent 8850f51fd0
commit f78792c779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,7 @@ class TopicViewWordpressSerializer < ApplicationSerializer
# These attributes will be delegated to the topic
attributes :id,
:category_id,
:posts_count,
:filtered_posts_count,
:posts
@ -15,6 +16,10 @@ class TopicViewWordpressSerializer < ApplicationSerializer
object.topic.id
end
def category_id
object.topic.category_id
end
def posts_count
object.topic.posts_count
end