From 915f3712ae7ae44c0cbe50c9694c25e3ee87a540 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 10 Oct 2019 02:22:04 +0200 Subject: Fix admin setting to auto-approve hashtags not affecting query (#12130) Follow-up to #12122 --- app/models/trending_tags.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/trending_tags.rb') diff --git a/app/models/trending_tags.rb b/app/models/trending_tags.rb index 8cdade42d..c69f6d3c3 100644 --- a/app/models/trending_tags.rb +++ b/app/models/trending_tags.rb @@ -90,7 +90,7 @@ class TrendingTags tag_ids = redis.zrevrange(KEY, 0, LIMIT - 1).map(&:to_i) tags = Tag.where(id: tag_ids) - tags = tags.where(trendable: true) if filtered + tags = tags.trendable if filtered tags = tags.each_with_object({}) { |tag, h| h[tag.id] = tag } tag_ids.map { |tag_id| tags[tag_id] }.compact.take(limit) -- cgit