Commit 927a05f4 by ivan Lan

Decode series spec_value to hash if snapshot delegate spec_value to it

parent 573e9d08
......@@ -86,11 +86,15 @@ module Shotengai
%i{
title cover_image banners detail
original_price price
spec_value
}.each do |column|
define_method(column) { super() || shotengai_series.send(column) }
end
def spec_value # Hash
super() || shotengai_series.spec_value.decode
end
# 重写 JsonColumn 中 column_has_implants 所生成的 detail_info_value 方法,
# 将未支付时的 detail_info_value 指派给 series.detail_info_template
# 'detail' 为 上方 column_has_implants 所指定的对应嵌入物(implants)
......@@ -114,6 +118,10 @@ module Shotengai
super || {}
end
def remark_value
super || {}
end
def product
shotengai_series.product
end
......@@ -167,7 +175,7 @@ module Shotengai
end
def remark_template_empty?
remark_template.empty? && remark_value.nil? # 当且仅当二者都为空才跳过验证
remark_template.empty? && remark_value.empty? # 当且仅当二者都为空才跳过验证
end
def check_remark_value
......
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