Fix bug.
This commit is contained in:
parent
3f3c966597
commit
1fa0351adf
|
@ -85,8 +85,8 @@ class Admin::UniversalTablesController < OrbitAdminController
|
||||||
if !table.nil?
|
if !table.nil?
|
||||||
sheet = workbook[0]
|
sheet = workbook[0]
|
||||||
if sheet.count <= 503
|
if sheet.count <= 503
|
||||||
columns = sheet[1].cells.collect{|c|
|
columns = sheet[1].cells.collect.with_index{|c,i|
|
||||||
table.table_columns.where(:key => c.value.to_s).first rescue nil
|
c.value.blank? ? table.table_columns.where(:title => sheet[0].cells[i].value.to_s.split("-").first.strip).first : table.table_columns.where(:key => c.value.to_s).first
|
||||||
}
|
}
|
||||||
languages = sheet[2].cells.collect{|c|
|
languages = sheet[2].cells.collect{|c|
|
||||||
c.value.split("-").last rescue nil
|
c.value.split("-").last rescue nil
|
||||||
|
|
Loading…
Reference in New Issue