a small fix for no chinese translations

This commit is contained in:
Harry Bomrah 2014-10-08 18:30:54 +08:00
parent f3dd0b8295
commit f2de4eb0e3
1 changed files with 1 additions and 1 deletions

View File

@ -625,7 +625,7 @@ class Admin::ImportController < OrbitAdminController
cat = Category.where(:title => category[1]["zh_tw"], :module_app_id => module_app.id).first
if cat.nil?
cat = Category.new
cat.title_translations = {"en" => category[1]["en"], "zh_tw" => category[1]["zh_tw"]}
cat.title_translations = {"en" => (category[1]["en"] || category[1]["zh_tw"]), "zh_tw" => (category[1]["zh_tw"] || category[1]["en"])}
cat.save
module_app.categories << cat
end