Return 0 if there is no topic associated with the post

This commit is contained in:
scossar 2018-01-22 09:54:11 -08:00
parent 22ca5a772d
commit 841a988454

View File

@ -19,7 +19,7 @@ class WebHookPostSerializer < PostSerializer
end
def topic_posts_count
object.topic && object.topic.posts_count
object.topic ? object.topic.posts_count : 0
end
end