Commit 2637e37eb9c881b8d698585f67ff8a6466bfd0c8

Authored by Andrey Karpikov
1 parent eb338bb7

check sorting

@@ -80,16 +80,16 @@ module Kanjai @@ -80,16 +80,16 @@ module Kanjai
80 if subpart 80 if subpart
81 markers_position = {} 81 markers_position = {}
82 82
83 - names_array = [] 83 + names_array = {}
84 84
85 (subpart.conditions || []).each do |item| 85 (subpart.conditions || []).each do |item|
86 - names_array << item["name"] 86 + names_array[item["name"]] = item["name"]
87 end 87 end
88 subpart.field_options.each do |item| 88 subpart.field_options.each do |item|
89 - names_array << item[:name] 89 + names_array[item[:itemName]] = item[:name]
90 end 90 end
91 91
92 - names_array.uniq.sort.each_with_index do |name, index| 92 + names_array.sort.to_h.values.each_with_index do |name, index|
93 markers_position[name] = index 93 markers_position[name] = index
94 end 94 end
95 95
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.260" 2 + VERSION = "0.0.261"
3 end 3 end