1
0
Fork 0
forked from gitea/nas

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

This commit is contained in:
KMY 2024-04-09 12:15:51 +09:00
commit 52c5784910
34 changed files with 186 additions and 159 deletions

View file

@ -284,13 +284,13 @@ module Account::Interactions
def followers_for_local_distribution
followers.local
.joins(:user)
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
.merge(User.signed_in_recently)
end
def lists_for_local_distribution
scope = lists.joins(account: :user)
scope.where.not(list_accounts: { follow_id: nil }).or(scope.where(account_id: id))
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
.merge(User.signed_in_recently)
end
def remote_followers_hash(url)

View file

@ -14,6 +14,10 @@ module Cacheable
includes(@cache_associated)
end
def preload_cacheable_associations(records)
ActiveRecord::Associations::Preloader.new(records: records, associations: @cache_associated).call
end
def cache_ids
select(:id, :updated_at)
end