Commit 340eacd8 authored by Benoît Sibaud's avatar Benoît Sibaud Committed by Bruno Michel

Popular tags based only on public nodes

parent e1a2cb2e
Pipeline #226 failed with stages
......@@ -20,8 +20,10 @@ class Tag < ActiveRecord::Base
scope :footer, -> {
select([:name]).joins(:taggings).
where(public: true).
where("created_at > ?", 1.month.ago).
group(:tag_id).
joins(:nodes).
where("nodes.public = 1").
where("taggings.created_at > ?", 1.month.ago).
group("taggings.tag_id").
order(Arel.sql("COUNT(*) DESC")).
limit(12)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment