5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-24 12:26:21 +00:00
panel/db/migrate/20240319124212_add_fedipact_to_fediblocks.rb

27 lines
841 B
Ruby
Raw Permalink Normal View History

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