mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 20:36:21 +00:00
33 lines
680 B
Ruby
33 lines
680 B
Ruby
|
# 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
|