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

This commit is contained in:
KMY 2024-02-09 12:53:59 +09:00
commit 05e52a09a8
188 changed files with 2810 additions and 1295 deletions

View file

@ -9,6 +9,8 @@
#
class Instance < ApplicationRecord
include DatabaseViewRecord
self.primary_key = :domain
attr_accessor :failure_days
@ -29,10 +31,6 @@ class Instance < ApplicationRecord
scope :by_domain_and_subdomains, ->(domain) { where("reverse('.' || domain) LIKE reverse(?)", "%.#{domain}") }
scope :with_domain_follows, ->(domains) { where(domain: domains).where(domain_account_follows) }
def self.refresh
Scenic.database.refresh_materialized_view(table_name, concurrently: true, cascade: false)
end
def self.domain_account_follows
Arel.sql(
<<~SQL.squish
@ -46,10 +44,6 @@ class Instance < ApplicationRecord
)
end
def readonly?
true
end
def delivery_failure_tracker
@delivery_failure_tracker ||= DeliveryFailureTracker.new(domain)
end