fix error

This commit is contained in:
邱博亞 2021-12-07 10:19:26 +08:00
parent 74776dce36
commit fa41d7c061
1 changed files with 5 additions and 22 deletions

View File

@ -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}
end
project.project_title_translations = value
when 4
value = {"en" => val}
when 5
begin
value["zh_tw"] = val
rescue
value = {"zh_tw" => val}
end
project.job_title_translations = value
when 6
value = {"en" => val}
when 7
begin
value["zh_tw"] = val
rescue
value = {"zh_tw" => val}
end
project.participator_translations = value
when 8
value = {"en" => val}
when 9
begin
value["zh_tw"] = val
rescue
value = {"zh_tw" => val}
end
project.unit_translations = value
when 10
project.year = val