mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #5510 from discourse/add-posts-count-to-web-hook-post-serializer
Feature: add topic posts count to webhook post serializer
This commit is contained in:
@@ -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 : 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user