mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 06:26:22 +00:00
fix: primero guardar el objeto antes de obtener su contenido
This commit is contained in:
parent
5dbff20e2b
commit
ddaee30da7
1 changed files with 5 additions and 5 deletions
|
@ -97,13 +97,13 @@ module Api
|
||||||
# @return [ActivityPub::Object]
|
# @return [ActivityPub::Object]
|
||||||
def object
|
def object
|
||||||
@object ||= ActivityPub::Object.type_from(original_object).find_or_initialize_by(uri: object_uri).tap do |o|
|
@object ||= ActivityPub::Object.type_from(original_object).find_or_initialize_by(uri: object_uri).tap do |o|
|
||||||
if object_embedded?
|
o.content = original_object if object_embedded?
|
||||||
o.content = original_object
|
|
||||||
else
|
|
||||||
ActivityPub::FetchJob.perform_later(site: site, object: o)
|
|
||||||
end
|
|
||||||
|
|
||||||
o.save!
|
o.save!
|
||||||
|
|
||||||
|
# XXX: el objeto necesita ser guardado antes de poder
|
||||||
|
# procesarlo
|
||||||
|
ActivityPub::FetchJob.perform_later(site: site, object: o) unless object_embedded?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue