Commit 3f38ba59 by ivan Lan

Delegate detail_info_value to series if a snapshot is unpaid

parent 0f93acca
...@@ -79,12 +79,19 @@ module Shotengai ...@@ -79,12 +79,19 @@ module Shotengai
# 支付前 信息 delegate to series # 支付前 信息 delegate to series
%i{ %i{
original_price price spec_value banners title cover_image banners detail
cover_image detail title original_price price
spec_value
}.each do |column| }.each do |column|
define_method(column) { super() || self.series.send(column) } define_method(column) { super() || self.series.send(column) }
end end
# 重写 JsonColumn 中 column_has_implants 所生成的 detail_info_value 方法,
# 将未支付时的 detail_info_value 指派给 series.detail_info_template
def detail_info_value
full_info_value['detail'] || series.detail_info_template.decode
end
def already_disable def already_disable
series.deleted? || product.on_sale?.! series.deleted? || product.on_sale?.!
end end
...@@ -115,7 +122,7 @@ module Shotengai ...@@ -115,7 +122,7 @@ module Shotengai
product_meta: product.meta, product_meta: product.meta,
series_meta: series.meta, series_meta: series.meta,
meta: meta, meta: meta,
detail_info_value: series.detail_info_template, detail_info_value: series.detail_info_template.decode,
info_value: info_value, info_value: info_value,
) )
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