exclude empty tags from tag cache (#1012)

This commit is contained in:
Toks
2013-04-13 14:55:21 -04:00
parent 14513fa141
commit a1dfa2a0b1

View File

@@ -3,6 +3,7 @@ class ApiCacheGenerator
File.open("#{Rails.root}/public/cache/tags.json", "w") do |f|
f.print("[")
Tag.find_each do |tag|
next unless tag.post_count > 0
hash = {
"name" => tag.name,
"id" => tag.id,