Add topic.posts_count to web_hook_posts_serializer

This commit is contained in:
scossar 2018-01-17 10:40:21 -08:00
parent 7eb9f4d9f7
commit 2646eb5e1d
1 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,7 @@
class WebHookPostSerializer < PostSerializer
attributes :topic_posts_count
def include_topic_title?
true
end
@ -14,4 +17,9 @@ class WebHookPostSerializer < PostSerializer
false
end
end
def topic_posts_count
object.topic && object.topic.posts_count
end
end