Commit 51424f9e by ivan Lan

Add harray decode to JsonColumn :template_with_value

parent 6d68782d
...@@ -37,9 +37,10 @@ module Shotengai ...@@ -37,9 +37,10 @@ module Shotengai
def template_with_value key, value: "#{key}_value", template: "#{key}_template" def template_with_value key, value: "#{key}_value", template: "#{key}_template"
class_eval %Q{ class_eval %Q{
def #{key} def #{key}
val = #{value}.is_a?(Harray) ? value.decode : value
{ {
template: Shotengai::Harray.encode(#{template}).keys, template: Shotengai::Harray.encode(#{template}).keys,
value: #{value}, value: val,
} }
end end
} }
......
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