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