mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Refactor topics controller
Refactor: 1) TopicsController to reduce code climate complexity. 2) Topic model, addressed comments fix typo
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user