small sorting fix for import

This commit is contained in:
Harry Bomrah 2015-12-18 15:33:43 +08:00
parent 99006e2507
commit 2fedf64387
2 changed files with 4 additions and 4 deletions

View File

@ -64,14 +64,14 @@ class Admin::UniversalTablesController < OrbitAdminController
case tc.type
when "text"
v = {}
@site_in_use_locales.each_with_index do |locale,x|
@site_in_use_locales.sort.each_with_index do |locale,x|
v[locale.to_s] = row.cells[index + x].value rescue nil
skip = skip + 1
end
ce.text_translations = v
when "editor"
v = {}
@site_in_use_locales.each_with_index do |locale,x|
@site_in_use_locales.sort.each_with_index do |locale,x|
v[locale.to_s] = row.cells[index + x].value rescue nil
skip = skip + 1
end

View File

@ -13,13 +13,13 @@ wb.add_worksheet(name: "Structure") do |sheet|
@table.table_columns.asc(:order).each do |column|
case column.type
when "text"
@site_in_use_locales.each do |locale|
@site_in_use_locales.sort.each do |locale|
row << column.title + " - " + t(locale.to_s)
row1 << column.key
row2 << column.type + "-#{locale}"
end
when "editor"
@site_in_use_locales.each do |locale|
@site_in_use_locales.sort.each do |locale|
row << column.title + " - " + t(locale.to_s)
row1 << column.key
row2 << column.type + "-#{locale}"