Commit 35b5609e572f6623ed8f775d2b66137d607a22f3

Authored by Andrey Karpikov
1 parent e81d3997

check repeat element

@@ -118,9 +118,11 @@ module Kanjai @@ -118,9 +118,11 @@ module Kanjai
118 scope = {lang: lang, row_item: index, repeat_id: repeat_id, parent_id: parent_id} 118 scope = {lang: lang, row_item: index, repeat_id: repeat_id, parent_id: parent_id}
119 119
120 exist_markers = page_content.page_content_markers.where(scope).pluck(:marker) 120 exist_markers = page_content.page_content_markers.where(scope).pluck(:marker)
  121 + uuid = page_content.page_content_markers.where(scope).first.uuid
121 item[:field_options].select{|item| item[:attributes]['repeatItemId'] == repeat_id.to_s }.each do |marker| 122 item[:field_options].select{|item| item[:attributes]['repeatItemId'] == repeat_id.to_s }.each do |marker|
122 unless exist_markers.include?(marker[:name]) 123 unless exist_markers.include?(marker[:name])
123 page_content.page_content_markers.create( 124 page_content.page_content_markers.create(
  125 + uuid: uuid,
124 marker: marker[:name], 126 marker: marker[:name],
125 row_item: index, 127 row_item: index,
126 marker_name: marker[:itemName], 128 marker_name: marker[:itemName],
@@ -139,6 +141,7 @@ module Kanjai @@ -139,6 +141,7 @@ module Kanjai
139 item[:conditions].select{|item| item[:repeat_id].to_s == repeat_id.to_s }.each do |marker| 141 item[:conditions].select{|item| item[:repeat_id].to_s == repeat_id.to_s }.each do |marker|
140 unless exist_markers.include?(marker[:id]) 142 unless exist_markers.include?(marker[:id])
141 page_content.page_content_markers.create( 143 page_content.page_content_markers.create(
  144 + uuid: uuid,
142 marker: marker[:id], 145 marker: marker[:id],
143 row_item: index, 146 row_item: index,
144 marker_name: marker[:name], 147 marker_name: marker[:name],
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.291" 2 + VERSION = "0.0.292"
3 end 3 end