5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-11 08:16:55 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-14 18:42:12 +00:00
commit 04ef814bd8
2 changed files with 16 additions and 0 deletions

View file

@ -24,9 +24,13 @@ class ActivityPub
return unless response.ok?
return if response.miss? && object.content.present?
current_type = object.type
content = FastJsonparser.parse(response.body)
object.update(content: content, type: ActivityPub::Object.type_from(content).name)
# Arreglar las relaciones con actividades también
ActivityPub.where(object_id: object.id).update_all(object_type: object.type) unless current_type == object.type
end
end
end

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
# Arregla la relación rota entre ActivityPub y Objects
class FixObjectTypeOnActivityPubs < ActiveRecord::Migration[6.1]
def up
ActivityPub::Object.where.not(type: 'ActivityPub::Object::Generic').find_each do |object|
ActivityPub.where(object_id: object.id).update_all(type: object.type, updated_at: Time.now)
end
end
def down; end
end