|
|
@@ -12,10 +12,12 @@ class Product < ActiveRecord::Base
|
|
|
SIZE_ENUM = []
|
|
|
def get_size_enum
|
|
|
@Size = ProductAttrConfig.where("product_id=? and size_type='size'",self.id).first
|
|
|
- @productAttrs = ProductAttr.where("attr_key_id=?",@Size.id).order("recommend desc")
|
|
|
- @productAttrs.each do |attr|
|
|
|
- a=[attr.name,attr.id]
|
|
|
- SIZE_ENUM.push(a)
|
|
|
+ if !@Size.blank?
|
|
|
+ @productAttrs = ProductAttr.where("attr_key_id=?",@Size.id).order("recommend desc")
|
|
|
+ @productAttrs.each do |attr|
|
|
|
+ a=[attr.name,attr.id]
|
|
|
+ SIZE_ENUM.push(a)
|
|
|
+ end
|
|
|
end
|
|
|
end
|
|
|
IMG_STORE_PATH = "product"
|