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

29 lines
601 B
Ruby
Raw 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
has_many :instance_moderations
2024-02-21 15:46:38 +00:00
aasm do
state :paused, initial: true
state :allowed
state :blocked
end
def uri
@uri ||= "https://#{hostname}/"
end
end
end