Add topic.posts_count to web_hook_posts_serializer
This commit is contained in:
parent
7eb9f4d9f7
commit
2646eb5e1d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue