mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-17 00:21:47 +00:00
28 lines
584 B
Ruby
28 lines
584 B
Ruby
![]() |
# frozen_string_literal: true
|
||
|
|
||
|
# Mantiene el registro de relaciones entre sitios e instancias
|
||
|
class InstanceModeration < ApplicationRecord
|
||
|
include AASM
|
||
|
|
||
|
belongs_to :site
|
||
|
belongs_to :instance, class_name: 'ActivityPub::Instance'
|
||
|
|
||
|
aasm do
|
||
|
state :paused, initial: true
|
||
|
state :allowed
|
||
|
state :blocked
|
||
|
|
||
|
event :pause do
|
||
|
transitions from: %i[allowed blocked], to: :paused
|
||
|
end
|
||
|
|
||
|
event :allow do
|
||
|
transitions from: %i[paused blocked], to: :allowed
|
||
|
end
|
||
|
|
||
|
event :block do
|
||
|
transitions from: %i[paused allowed], to: :blocked
|
||
|
end
|
||
|
end
|
||
|
end
|