FIX: Importers should allow categories with existing name if the parent category is different

This changes the content of `@categories_lookup` from `Category` objects
to IDs since the category names aren't needed anymore. The lookup
method has been renamed too.
This commit is contained in:
Gerhard Schlager
2015-03-12 21:15:02 +01:00
parent 091af27a31
commit b5426763e4
14 changed files with 27 additions and 31 deletions

View File

@ -61,7 +61,7 @@ class ImportScripts::DrupalQA < ImportScripts::Drupal
{
id: "nid:#{row['nid']}",
user_id: user_id_from_imported_user_id(row['uid']) || -1,
category: category_from_imported_category_id((row['tid'] || '').split(',')[0]).try(:name),
category: category_id_from_imported_category_id((row['tid'] || '').split(',')[0]),
raw: row['body'],
created_at: Time.zone.at(row['created']),
pinned_at: nil,