2024-03-19 12:47:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Agrega threads.net a las listas de bloqueo
|
|
|
|
class AddFedipactToFediblocks < ActiveRecord::Migration[6.1]
|
|
|
|
def up
|
2024-03-19 12:49:34 +00:00
|
|
|
change_column :activity_pub_fediblocks, :download_url, :string, null: true
|
|
|
|
|
2024-03-19 12:47:24 +00:00
|
|
|
fedipact =
|
|
|
|
ActivityPub::Fediblock.create(
|
|
|
|
hostnames: %w[threads.net],
|
|
|
|
title: 'Fedipact',
|
|
|
|
url: 'https://fedipact.online/',
|
|
|
|
format: 'none'
|
|
|
|
)
|
|
|
|
|
|
|
|
DeploySocialDistributedPress.find_each do |deploy|
|
2024-05-02 19:05:35 +00:00
|
|
|
FediblockState.create(site: deploy.site, fediblock: fedipact, aasm_state: 'disabled').tap(&:enable!)
|
2024-03-19 12:47:24 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
fedipact = ActivityPub::Fediblock.find_by(url: 'https://fedipact.online/').delete
|
|
|
|
FediblockState.where(fediblock_id: fedipact.id).delete_all
|
2024-03-19 12:49:34 +00:00
|
|
|
change_column :activity_pub_fediblocks, :download_url, :string, null: false
|
2024-03-19 12:47:24 +00:00
|
|
|
end
|
|
|
|
end
|