diff --git a/gossamer_forums.rb b/gossamer_forums.rb index 0a3b378..734a29a 100644 --- a/gossamer_forums.rb +++ b/gossamer_forums.rb @@ -1,5 +1,5 @@ # gossamer threads migration-import code -# v0.21.3 +# v0.21.4 require 'mysql2' require 'open-uri' @@ -300,10 +300,10 @@ class GossamerForumsImporter < ImportScripts::Base end # Helper method to upload an attachment / image to Discourse - def upload_attachment(user, file, filename, gossamer_url) + def upload_attachment(user_id, file, filename, gossamer_url) begin upload = Upload.create!( - user_id: user.id, + user_id: user_id, original_filename: filename, filesize: file.size, # filesize: File.size(file.path), @@ -320,7 +320,7 @@ class GossamerForumsImporter < ImportScripts::Base upload.save! upload rescue => e - puts "Failed to upload attachment #{filename} for user #{user.username}: #{e.message}" + puts "Failed to upload attachment #{filename} for user_id #{user_id}: #{e.message}" nil end end