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
|
class WebHookPostSerializer < PostSerializer
|
||||||
|
|
||||||
|
attributes :topic_posts_count
|
||||||
|
|
||||||
def include_topic_title?
|
def include_topic_title?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
@ -14,4 +17,9 @@ class WebHookPostSerializer < PostSerializer
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def topic_posts_count
|
||||||
|
object.topic && object.topic.posts_count
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue