Merge remote-tracking branch 'parent/main' into upstream-20240422

This commit is contained in:
KMY 2024-04-22 08:58:37 +09:00
commit 44f4a93430
100 changed files with 770 additions and 441 deletions

View file

@ -55,6 +55,8 @@ class Tag < ApplicationRecord
scope :listable, -> { where(listable: [true, nil]) }
scope :trendable, -> { Setting.trendable_by_default ? where(trendable: [true, nil]) : where(trendable: true) }
scope :not_trendable, -> { where(trendable: false) }
scope :suggestions_for_account, ->(account) { recently_used(account).not_featured_by(account) }
scope :not_featured_by, ->(account) { where.not(id: account.featured_tags.select(:tag_id)) }
scope :recently_used, lambda { |account|
joins(:statuses)
.where(statuses: { id: account.statuses.select(:id).limit(RECENT_STATUS_LIMIT) })