5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 20:36:21 +00:00
panel/app/models/actor_moderation.rb

33 lines
680 B
Ruby
Raw Normal View History

2024-02-28 20:34:34 +00:00
# frozen_string_literal: true
# Mantiene la relación entre Site y Actor
class ActorModeration < ApplicationRecord
include AASM
belongs_to :site
belongs_to :actor, class_name: 'ActivityPub::Actor'
aasm do
state :paused, initial: true
state :allowed
state :blocked
state :reported
event :pause do
transitions from: %i[allowed blocked reported], to: :paused
end
event :allowed do
transitions from: %i[paused blocked reported], to: :allowed
end
event :blocked do
transitions from: %i[paused allowed], to: :blocked
end
event :reported do
transitions from: %i[blocked], to: :reported
end
end
end