Commit 47142e835aa09f63f2c52d6b695574c8108e5fb8

Authored by Andrey Karpikov
1 parent 1241473f

check sorting

... ... @@ -79,13 +79,18 @@ module Kanjai
79 79 subpart = page_template.template_parts.where(code: page_content.type_content).first
80 80 if subpart
81 81 markers_position = {}
  82 +
  83 + names_array = []
82 84
83   - (subpart.conditions || []).sort{|a,b| a["name"] <=> b["name"] }.each_with_index do |item, index|
84   - markers_position[item["name"]] = index
  85 + (subpart.conditions || []).each do |item|
  86 + names_array << item["name"]
  87 + end
  88 + subpart.field_options.each do |item|
  89 + names_array << item[:name]
85 90 end
86 91
87   - subpart.field_options.sort_by{|item| item[:itemName].to_s }.each_with_index do |item, index|
88   - markers_position[item[:name]] = index + 100
  92 + names_array.uniq.each_with_index do |name, index|
  93 + markers_position[name] = index
89 94 end
90 95
91 96
... ...
1 1 module Kanjai
2   - VERSION = "0.0.258"
  2 + VERSION = "0.0.259"
3 3 end
... ...