exclude empty tags from tag cache (#1012)
This commit is contained in:
@@ -3,6 +3,7 @@ class ApiCacheGenerator
|
|||||||
File.open("#{Rails.root}/public/cache/tags.json", "w") do |f|
|
File.open("#{Rails.root}/public/cache/tags.json", "w") do |f|
|
||||||
f.print("[")
|
f.print("[")
|
||||||
Tag.find_each do |tag|
|
Tag.find_each do |tag|
|
||||||
|
next unless tag.post_count > 0
|
||||||
hash = {
|
hash = {
|
||||||
"name" => tag.name,
|
"name" => tag.name,
|
||||||
"id" => tag.id,
|
"id" => tag.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user