Merge commit '119c7aa0df1e1d26bdee1701250d23a7af9e9136' into glitch-soc/merge-upstream

This commit is contained in:
Claire committed 2024-04-06 20:34:07 +02:00
commit 777984faeb
70 files changed
+547 -104

No files matched your search

@@ -8,16 +8,22 @@
# id :bigint(8) not null, primary key
# account_id :bigint(8) not null
# relationship_severance_event_id :bigint(8) not null
# relationships_count :integer default(0), not null
# created_at :datetime not null
# updated_at :datetime not null
# followers_count :integer default(0), not null
# following_count :integer default(0), not null
#
class AccountRelationshipSeveranceEvent < ApplicationRecord
self.ignored_columns += %w(
relationships_count
)
belongs_to :account
belongs_to :relationship_severance_event
delegate :severed_relationships,
:type,
has_many :severed_relationships, through: :relationship_severance_event
delegate :type,
:target_name,
:purged,
:purged?,
@@ -29,6 +35,7 @@ class AccountRelationshipSeveranceEvent < ApplicationRecord
private
def set_relationships_count!
self.relationships_count = severed_relationships.about_local_account(account).count
self.followers_count = severed_relationships.about_local_account(account).passive.count
self.following_count = severed_relationships.about_local_account(account).active.count
end
end
+10
View File
@@ -27,6 +27,16 @@ module Account::Merging
end
end
[
Notification, NotificationPermission, NotificationRequest
].each do |klass|
klass.where(from_account_id: other_account.id).reorder(nil).find_each do |record|
record.update_attribute(:from_account_id, id)
rescue ActiveRecord::RecordNotUnique
next
end
end
target_classes = [
Follow, FollowRequest, Block, Mute, AccountModerationNote, AccountPin,
AccountNote
-2
View File
@@ -14,7 +14,6 @@
# sign_in_count :integer default(0), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# admin :boolean default(FALSE), not null
# confirmation_token :string
# confirmed_at :datetime
# confirmation_sent_at :datetime
@@ -29,7 +28,6 @@
# otp_backup_codes :string is an Array
# account_id :bigint(8) not null
# disabled :boolean default(FALSE), not null
# moderator :boolean default(FALSE), not null
# invite_id :bigint(8)
# chosen_languages :string is an Array
# created_by_application_id :bigint(8)