diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 189b7e6..1ae2ebe 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,7 +1,7 @@ # Federated Computer, Inc. # David Sainty 2024 A.D. # Gossamer Threads to Discourse -- Migration-Import Script -# v0.36.2 Rewrite broken upload_attachment due to 3.2.5 handling things differently +# v0.36.4 Rewrite broken upload_attachment due to 3.2.5 handling things differently require 'mysql2' require 'open-uri' @@ -397,6 +397,9 @@ class GossamerForumsImporter < ImportScripts::Base # retain_hours: nil ) + # Save the upload object before generating the file path + upload.save! + # Use FileStore::LocalStore to store the file store = FileStore::LocalStore.new upload.url = store.store_file(file, store.get_path_for('original', upload.id, upload.sha1, File.extname(file.path)))