Commit a37c5162 by ivan Lan

Fix JsonColumn about :template_with_value nil spec_value

parent cc41041e
...@@ -36,7 +36,7 @@ module Shotengai ...@@ -36,7 +36,7 @@ module Shotengai
def template_with_value key, value: "#{key}_value", template: "#{key}_template", trans: nil, trans_to: :en def template_with_value key, value: "#{key}_value", template: "#{key}_template", trans: nil, trans_to: :en
trans_result = trans.is_a?(Hash) ? %Q{ trans_result = trans.is_a?(Hash) ? %Q{
#{trans_to}_value: val.reduce({}) do |o, obj| #{trans_to}_value: val&.reduce({}) do |o, obj|
trans = #{trans} trans = #{trans}
val = obj[1].is_a?(Array) ? obj[1].map{ |x| trans[x] } : trans[ obj[1] ] val = obj[1].is_a?(Array) ? obj[1].map{ |x| trans[x] } : trans[ obj[1] ]
o.merge( obj[0] => val ) o.merge( obj[0] => val )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment