Refactor topics controller

Refactor: 1) TopicsController to reduce code climate complexity.
2) Topic model, addressed comments

fix typo
This commit is contained in:
Manoj
2013-10-28 11:42:07 +05:30
parent c0d85fa6f9
commit 9650dbb97c
4 changed files with 70 additions and 42 deletions

View File

@@ -183,6 +183,10 @@ class Topic < ActiveRecord::Base
end
end
def self.count_exceeds_minimum?
count > SiteSetting.minimum_topics_similar
end
def best_post
posts.order('score desc').limit(1).first
end