PERF: cache category topic ids

This commit is contained in:
Sam
2016-07-19 12:34:54 +10:00
parent c1a01b2a28
commit 1c964bf730
3 changed files with 17 additions and 2 deletions

View File

@ -7,7 +7,7 @@ class SuggestedTopicsBuilder
def initialize(topic)
@excluded_topic_ids = [topic.id]
@category_id = topic.category_id
@category_topic_ids = Category.pluck(:topic_id).compact
@category_topic_ids = Category.topic_ids
@results = []
end