correct import script

This commit is contained in:
Sam 2014-11-20 14:53:30 +11:00
parent 6bed4e1bf0
commit 4aec3c8c4c

View file

@ -28,8 +28,8 @@ class ImportScripts::Bespoke < ImportScripts::Base
end end
def execute def execute
#import_users import_users
#import_categories import_categories
import_posts import_posts
end end
@ -146,6 +146,8 @@ class ImportScripts::Bespoke < ImportScripts::Base
created_at = DateTime.parse(row.dcreate) created_at = DateTime.parse(row.dcreate)
username = name if username == "NULL" username = name if username == "NULL"
username = email.split("@")[0] if username.blank?
name = email.split("@")[0] if name.blank?
users << { users << {
id: id, id: id,
@ -180,7 +182,7 @@ class ImportScripts::Bespoke < ImportScripts::Base
# purple and #1223f3 # purple and #1223f3
raw.gsub!(/\[color=[#a-z0-9]+\]/i, "") raw.gsub!(/\[color=[#a-z0-9]+\]/i, "")
raw.gsub!(/\[\/color\]/i, "") raw.gsub!(/\[\/color\]/i, "")
raw.gsub!(/\[signature\].+\[\/signature\]/i,"") raw.gsub!(/\[signature\].+\[\/signature\]/im,"")
raw raw
end end