Browse Source

增加商品属性定义

abiao 5 years ago
parent
commit
5126ea95f8
1 changed files with 4 additions and 3 deletions
  1. 4 3
      app/models/product_attr_config.rb

+ 4 - 3
app/models/product_attr_config.rb

@@ -15,6 +15,7 @@ class ProductAttrConfig < ActiveRecord::Base
         showProducts.each {|v| puts v}
         return showProducts
     end
+    PRODUCT_ENUM = show_products
     TYPE_ENUM = [["颜色","color"],["尺码","size"]]
     rails_admin do
         navigation_label '商品管理'
@@ -30,7 +31,7 @@ class ProductAttrConfig < ActiveRecord::Base
             field :id
             field :product_id, :enum do
                 enum do
-                    show_products
+                    PRODUCT_ENUM
                 end
             end
             field :product_attr_key
@@ -45,7 +46,7 @@ class ProductAttrConfig < ActiveRecord::Base
             field :id
             field :product_id, :enum do
                 enum do
-                    show_products
+                    PRODUCT_ENUM
                 end
             end
             field :product_attr_key
@@ -59,7 +60,7 @@ class ProductAttrConfig < ActiveRecord::Base
         edit do
             field :product_id, :enum do
                 enum do
-                    show_products
+                    PRODUCT_ENUM
                 end
             end
             field :product_attr_key