mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 23:56:22 +00:00
22 lines
474 B
Ruby
22 lines
474 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# = Instance =
|
||
|
#
|
||
|
# Representa cada instancia del fediverso que interactúa con la Social
|
||
|
# Inbox.
|
||
|
class ActivityPub::Instance < ApplicationRecord
|
||
|
include AASM
|
||
|
|
||
|
validates :aasm_state, presence: true, inclusion: { in: %w[paused allowed blocked] }
|
||
|
validates :hostname, uniqueness: true, hostname: true
|
||
|
|
||
|
has_many :activity_pubs
|
||
|
has_many :actors
|
||
|
|
||
|
aasm do
|
||
|
state :paused, initial: true
|
||
|
state :allowed
|
||
|
state :blocked
|
||
|
end
|
||
|
end
|