This commit is contained in:
Kara Diaby 2024-02-21 21:53:14 +00:00
parent 2612b0a2d1
commit 46bec10aa2

View file

@ -112,9 +112,12 @@ module Recovery
end
end
def import(pj)
ActiveStorage::Blob.insert(pj.blob.attributes)
ActiveStorage::Attachment.insert(pj.attributes)
def import(pjs)
attachments = pjs.respond_to?(:each) ? pjs : [pjs]
attachments.each do |pj|
ActiveStorage::Blob.insert(pj.blob.attributes)
ActiveStorage::Attachment.insert(pj.attributes)
end
end
end
end