about summary refs log tree commit diff
path: root/app/models/tag.rb
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-09-14 13:49:06 -0500
committerStarfall <us@starfall.systems>2020-09-14 13:49:06 -0500
commitbc32e736fbd7c6afd59e619c885fa80ab637324a (patch)
treeafc04eaa04aeb45b56c378bdc474428d6fdcc813 /app/models/tag.rb
parentfd0b806603dbd632d259d06af789c7195c7264dc (diff)
parentafa753a890197b188ddf7ba6a8493d4fe361d956 (diff)
Merge branch 'glitch' into main
Diffstat (limited to 'app/models/tag.rb')
-rw-r--r--app/models/tag.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index bce76fc16..df2f86d95 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -39,7 +39,7 @@ class Tag < ApplicationRecord
   scope :listable, -> { where(listable: [true, nil]) }
   scope :trendable, -> { Setting.trendable_by_default ? where(trendable: [true, nil]) : where(trendable: true) }
   scope :discoverable, -> { listable.joins(:account_tag_stat).where(AccountTagStat.arel_table[:accounts_count].gt(0)).order(Arel.sql('account_tag_stats.accounts_count desc')) }
-  scope :most_used, ->(account) { joins(:statuses).where(statuses: { account: account }).group(:id).order(Arel.sql('count(*) desc')) }
+  scope :recently_used, ->(account) { joins(:statuses).where(statuses: { id: account.statuses.select(:id).limit(1000) }).group(:id).order(Arel.sql('count(*) desc')) }
   scope :matches_name, ->(value) { where(arel_table[:name].matches("#{value}%")) }
 
   delegate :accounts_count,