Commit 229f3e0d1313c0eb8013b9e4d8fc1d3a8cabcb99

Authored by Karpikau Andrei
1 parent e1253055

add flag main field for element

@@ -121,7 +121,7 @@ module Kanjai @@ -121,7 +121,7 @@ module Kanjai
121 121
122 source.to_s.scan(/{"element":[\w\W\{]+?}}/).each do |str| 122 source.to_s.scan(/{"element":[\w\W\{]+?}}/).each do |str|
123 element_hash = JSON.parse(str) 123 element_hash = JSON.parse(str)
124 - @field_options << {:name => element_hash["element"]["title"], :itemName => element_hash["element"]["itemName"] , :attributes => {'type' => element_hash["element"]["type"], 'repeat' => repeat}, :source => nil, :children => {}} 124 + @field_options << {:name => element_hash["element"]["title"], :itemName => element_hash["element"]["itemName"] , main: element_hash["element"]["main"].to_i, :attributes => {'type' => element_hash["element"]["type"], 'repeat' => repeat}, :source => nil, :children => {}}
125 source.gsub!(str, element_hash["element"]["title"]) 125 source.gsub!(str, element_hash["element"]["title"])
126 end 126 end
127 127
@@ -129,7 +129,7 @@ module Kanjai @@ -129,7 +129,7 @@ module Kanjai
129 value.to_s.scan(/{"element":[\w\W\{]+?}}/).each do |str| 129 value.to_s.scan(/{"element":[\w\W\{]+?}}/).each do |str|
130 130
131 element_hash = JSON.parse(str) 131 element_hash = JSON.parse(str)
132 - @field_options << {:name => element_hash["element"]["title"], :itemName => element_hash["element"]["itemName"] , :attributes => {'type' => element_hash["element"]["type"], 'repeat' => repeat}, :source => nil, :children => {}} 132 + @field_options << {:name => element_hash["element"]["title"], :itemName => element_hash["element"]["itemName"] , main: element_hash["element"]["main"].to_i, :attributes => {'type' => element_hash["element"]["type"], 'repeat' => repeat}, :source => nil, :children => {}}
133 value.gsub!(str, element_hash["element"]["title"]) 133 value.gsub!(str, element_hash["element"]["title"])
134 end 134 end
135 end 135 end
1 module Kanjai 1 module Kanjai
2 - VERSION = "0.0.111" 2 + VERSION = "0.0.112"
3 end 3 end