FIX: bulk importers need to create category description topics

This commit is contained in:
Neil Lalonde 2018-03-07 12:10:15 -05:00
parent 90a1b48503
commit 1093dacc03
2 changed files with 9 additions and 1 deletions

View File

@ -196,7 +196,7 @@ SQL
t.delete_topic_timer(TopicTimer.types[:close])
t.save!(validate: false)
update_column(:topic_id, t.id)
t.posts.create(raw: post_template, user: user)
t.posts.create(raw: description || post_template, user: user)
end
def topic_url

View File

@ -259,6 +259,14 @@ class BulkImport::Base
end
end
def create_categories(rows, &block)
create_records(rows, "category", CATEGORY_COLUMNS, &block)
Category.where(topic_id: nil).each do |c|
c.create_category_definition
end
end
def create_user_emails(rows, &block) create_records(rows, "user_email", USER_EMAIL_COLUMNS, &block); end
def create_user_stats(rows, &block) create_records(rows, "user_stat", USER_STAT_COLUMNS, &block); end
def create_user_profiles(rows, &block); create_records(rows, "user_profile", USER_PROFILE_COLUMNS, &block); end