From 89e8ebf0b9ab84efad67ad6db592527d940f61f8 Mon Sep 17 00:00:00 2001 From: saint Date: Wed, 14 Aug 2024 23:47:51 +1000 Subject: [PATCH] v0.36.4 Rewrite broken upload_attachment due to 3.2.5 handling things differently --- gossamer_forums.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)))