5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 10:26:22 +00:00
panel/app/models/activity_pub/instance.rb

24 lines
507 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
# = Instance =
#
# Representa cada instancia del fediverso que interactúa con la Social
# Inbox.
2024-02-21 15:46:38 +00:00
class ActivityPub
class Instance < ApplicationRecord
include AASM
2024-02-21 15:46:38 +00:00
validates :aasm_state, presence: true, inclusion: { in: %w[paused allowed blocked] }
validates :hostname, uniqueness: true, hostname: true
2024-02-21 15:46:38 +00:00
has_many :activity_pubs
has_many :actors
2024-02-21 15:46:38 +00:00
aasm do
state :paused, initial: true
state :allowed
state :blocked
end
end
end