From 4aec3c8c4caef587f88fb628ac34c5fb8053effb Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 20 Nov 2014 14:53:30 +1100 Subject: [PATCH] correct import script --- script/import_scripts/bespoke_1.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb index e91a001a5..2b94283ae 100644 --- a/script/import_scripts/bespoke_1.rb +++ b/script/import_scripts/bespoke_1.rb @@ -28,8 +28,8 @@ class ImportScripts::Bespoke < ImportScripts::Base end def execute - #import_users - #import_categories + import_users + import_categories import_posts end @@ -146,6 +146,8 @@ class ImportScripts::Bespoke < ImportScripts::Base created_at = DateTime.parse(row.dcreate) username = name if username == "NULL" + username = email.split("@")[0] if username.blank? + name = email.split("@")[0] if name.blank? users << { id: id, @@ -180,7 +182,7 @@ class ImportScripts::Bespoke < ImportScripts::Base # purple and #1223f3 raw.gsub!(/\[color=[#a-z0-9]+\]/i, "") raw.gsub!(/\[\/color\]/i, "") - raw.gsub!(/\[signature\].+\[\/signature\]/i,"") + raw.gsub!(/\[signature\].+\[\/signature\]/im,"") raw end