From a1d1ee39f79c5bd836dffa676c938c1d2c5e79ec Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Thu, 20 Aug 2020 06:12:37 -0500 Subject: [Privacy] Choose random local follower for private fetches instead of first --- app/models/account.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index dab091bae..aad6dc728 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -120,6 +120,7 @@ class Account < ApplicationRecord scope :by_domain_and_subdomains, ->(domain) { where(domain: domain).or(where(arel_table[:domain].matches('%.' + domain))) } scope :not_excluded_by_account, ->(account) { where.not(id: account.excluded_from_timeline_account_ids) } scope :not_domain_blocked_by_account, ->(account) { where(arel_table[:domain].eq(nil).or(arel_table[:domain].not_in(account.excluded_from_timeline_domains))) } + scope :random, -> { reorder(Arel.sql('RANDOM()')).limit(1) } delegate :email, :unconfirmed_email, -- cgit