diff --git a/app/helpers/admin/personal_projects_helper.rb b/app/helpers/admin/personal_projects_helper.rb index f1b3bd9..a02dd7b 100644 --- a/app/helpers/admin/personal_projects_helper.rb +++ b/app/helpers/admin/personal_projects_helper.rb @@ -52,45 +52,28 @@ module Admin::PersonalProjectsHelper project = Project.new row.cells.each_with_index do |cell,index| next if index < 2 - next if cell.nil? - val = cell.value - next if val.nil? || val == "" + val = cell.value rescue nil case index when 2 value = {"en" => val} when 3 - begin - value["zh_tw"] = val - rescue - value = {"zh_tw" => val} + value["zh_tw"] = val end project.project_title_translations = value when 4 value = {"en" => val} when 5 - begin - value["zh_tw"] = val - rescue - value = {"zh_tw" => val} - end + value["zh_tw"] = val project.job_title_translations = value when 6 value = {"en" => val} when 7 - begin - value["zh_tw"] = val - rescue - value = {"zh_tw" => val} - end + value["zh_tw"] = val project.participator_translations = value when 8 value = {"en" => val} when 9 - begin - value["zh_tw"] = val - rescue - value = {"zh_tw" => val} - end + value["zh_tw"] = val project.unit_translations = value when 10 project.year = val