mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 06:36:21 +00:00
fix: permitir guardar le actore si la instancia ya existía
This commit is contained in:
parent
9e54d6311c
commit
a76c652f98
1 changed files with 4 additions and 4 deletions
|
@ -147,11 +147,11 @@ module Api
|
|||
# @return [Actor]
|
||||
def actor
|
||||
@actor ||= ActivityPub::Actor.find_or_initialize_by(uri: original_activity[:actor]).tap do |a|
|
||||
next if a.instance
|
||||
unless a.instance
|
||||
a.instance = ActivityPub::Instance.find_or_create_by(hostname: URI.parse(a.uri).hostname)
|
||||
|
||||
a.instance = ActivityPub::Instance.find_or_create_by(hostname: URI.parse(a.uri).hostname)
|
||||
|
||||
ActivityPub::InstanceFetchJob.perform_later(site: site, instance: a.instance)
|
||||
ActivityPub::InstanceFetchJob.perform_later(site: site, instance: a.instance)
|
||||
end
|
||||
|
||||
a.save!
|
||||
|
||||
|
|
Loading…
Reference in a new issue