This commit is contained in:
Toks
2014-01-08 14:40:07 -05:00
parent 1a70b9fb97
commit 929408a421
3 changed files with 12 additions and 1 deletions

View File

@@ -41,6 +41,12 @@ class Tag < ActiveRecord::Base
def counts_for(tag_names)
select_all_sql("SELECT name, post_count FROM tags WHERE name IN (?)", tag_names)
end
def highest_post_count
Cache.get("highest-post-count", 4.hours) do
select("post_count").order("post_count DESC").first.post_count
end
end
end
def real_post_count