mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
correct import script
This commit is contained in:
parent
6bed4e1bf0
commit
4aec3c8c4c
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue