5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-11 14:16:55 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-14 14:21:10 +00:00
commit 0ef559ba9a
2 changed files with 17 additions and 2 deletions

View file

@ -24,8 +24,8 @@ class ActivityPub
# Encontrar todas las acciones de moderación de le actore
# eliminade y moverlas a eliminar.
if object.actor_type? && object.actor.present?
ActorModeration.where(actor_id: object.actor.id).remove_all!
if (actor = ActivityPub::Actor.find_by(uri: o.uri)).present?
ActorModeration.where(actor_id: actor.id).remove_all!
end
end

View file

@ -0,0 +1,15 @@
# frozen_string_literal: true
# Elimina actores que no pudieron ser eliminades porque su perfil ya no
# existe.
class RemoveActorModerationsForGenericObjects < ActiveRecord::Migration[6.1]
def up
object_ids = ActivityPub.removed.where(object_type: 'ActivityPub::Object::Generic').distinct.pluck(:object_id)
uris = ActivityPub::Object.where(id: object_ids).pluck(:uri)
actor_ids = ActivityPub::Actor.where(uri: uris).ids
ActorModeration.where(actor_id: actor_ids).remove_all!
end
def down; end
end