Showing
2 changed files
with
3 additions
and
3 deletions
| @@ -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 |