5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-02-17 00:21:47 +00:00
panel/app/models/instance_moderation.rb

28 lines
584 B
Ruby
Raw Normal View History

# 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