Commit 0b76f7be by ivan Lan

Set default val to meta

parent 12f877a6
......@@ -124,6 +124,10 @@ module Shotengai
end
end
def meta
super || {}
end
class << self
def inherited subclass
# define Cart class
......
......@@ -63,6 +63,10 @@ module Shotengai
Shotengai::Series.find_by_id(default_series_id) || series.first
end
def meta
super || {}
end
class << self
def series_class
Shotengai::Series
......
......@@ -30,7 +30,7 @@ module Shotengai
delegate :title, :detail, :banners, :cover_image, :status, :status_zh, to: :product
# where(spec->'$.\"颜色\"' = ? and spec->'$.\"大小\"' = ? ,红色,S)
# where("spec->'$.\"颜色\"' = ? and spec->'$.\"大小\"' = ?" ,红色,S)
scope :query_spec_with_product, ->(val, product) {
if val.keys.sort == product.spec.keys.sort
keys = []; values = []
......@@ -72,6 +72,10 @@ module Shotengai
read_attribute(:original_price) || price
end
def meta
super || {}
end
private
# spec 字段
def check_spec_value
......
......@@ -120,6 +120,10 @@ module Shotengai
######
def meta
super || {}
end
private
# spec 字段
def check_spec
......
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