add perf note

This commit is contained in:
Sam 2015-01-05 17:54:38 +11:00
parent 0396fd66f6
commit 222964b27b
1 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,9 @@ class TopicListItemSerializer < ListableTopicSerializer
end
def include_op_like_count?
# PERF: long term we probably want a cheaper way of looking stuff up
# this is rather odd code, but we need to have op_likes loaded somehow
# simplest optimisation is adding a cache column on topic.
object.association(:first_post).loaded?
end