2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

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

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