Просмотр исходного кода

商品规格 关联增加限制条件

abiao лет назад: 5
Родитель
Сommit
08d6a27bef
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      app/models/product_attr_config.rb

+ 4 - 0
app/models/product_attr_config.rb

@@ -2,6 +2,7 @@ class ProductAttrConfig < ActiveRecord::Base
     has_paper_trail
     self.table_name = 'product_attr_configs'
     belongs_to :product_attr_key, :foreign_key => :attr_key_id
+    belongs_to :product, :foreign_key => :product_id,:show_flag => 1
     validates :size_type,:product_id,:product_attr_key,presence:true
     attr_accessor :show_products
 
@@ -53,11 +54,14 @@ class ProductAttrConfig < ActiveRecord::Base
         end
 
         edit do
+=begin
             field :product_id, :enum do
                 enum do
                   PRODUCT_ENUM
                 end
             end
+=end
+            field :product
             field :product_attr_key
             field :size_type, :enum do
                 enum do