diff --git a/app/models/activity_pub.rb b/app/models/activity_pub.rb index 61120a58..a6b1401b 100644 --- a/app/models/activity_pub.rb +++ b/app/models/activity_pub.rb @@ -12,7 +12,6 @@ class ActivityPub < ApplicationRecord IGNORED_STATES = %i[removed] include AASM - include AasmEventsConcern belongs_to :instance belongs_to :site @@ -91,6 +90,9 @@ class ActivityPub < ApplicationRecord end end + # Definir eventos en masa + include AasmEventsConcern + def reject_remotely! raise unless site.social_inbox.inbox.reject(id: object.uri).ok? end diff --git a/app/models/activity_pub/remote_flag.rb b/app/models/activity_pub/remote_flag.rb index 1b6f5c5f..70f09dcc 100644 --- a/app/models/activity_pub/remote_flag.rb +++ b/app/models/activity_pub/remote_flag.rb @@ -6,7 +6,6 @@ class ActivityPub IGNORED_STATES = [] include AASM - include AasmEventsConcern aasm do state :waiting, initial: true @@ -26,6 +25,9 @@ class ActivityPub end end + # Definir eventos en masa + include AasmEventsConcern + belongs_to :actor belongs_to :site diff --git a/app/models/actor_moderation.rb b/app/models/actor_moderation.rb index ad29739f..7e68f60b 100644 --- a/app/models/actor_moderation.rb +++ b/app/models/actor_moderation.rb @@ -6,7 +6,6 @@ class ActorModeration < ApplicationRecord IGNORED_STATES = %i[removed] include AASM - include AasmEventsConcern belongs_to :site belongs_to :remote_flag, optional: true, class_name: 'ActivityPub::RemoteFlag' @@ -74,6 +73,9 @@ class ActorModeration < ApplicationRecord end end + # Definir eventos en masa + include AasmEventsConcern + def pause_remotely! raise unless actor.mention && diff --git a/app/models/instance_moderation.rb b/app/models/instance_moderation.rb index 1ed7d2c0..5b246cee 100644 --- a/app/models/instance_moderation.rb +++ b/app/models/instance_moderation.rb @@ -6,7 +6,6 @@ class InstanceModeration < ApplicationRecord IGNORED_STATES = [] include AASM - include AasmEventsConcern belongs_to :site belongs_to :instance, class_name: 'ActivityPub::Instance' @@ -51,6 +50,9 @@ class InstanceModeration < ApplicationRecord end end + # Definir eventos en masa + include AasmEventsConcern + # @return [Array] def actor_ids ActivityPub::Actor.where(instance_id: self.instance_id).ids