|
|
@@ -7,7 +7,7 @@ class Product < ActiveRecord::Base
|
|
|
scope :inactive, -> { where(ptype: "direct_sale") }
|
|
|
belongs_to :product_cat, :foreign_key => :category_id
|
|
|
belongs_to :merchant, :foreign_key => :merchant_id
|
|
|
- validates :name,:buy_price,:price,:category_id,:count,:robo_balance_price,:relate_product_id, presence: true
|
|
|
+ validates :product_no,:name,:buy_price,:price,:category_id,:count,:robo_balance_price,:relate_product_id, presence: true
|
|
|
validate :product_validation
|
|
|
|
|
|
def product_validation
|
|
|
@@ -171,7 +171,8 @@ class Product < ActiveRecord::Base
|
|
|
enum do
|
|
|
TYPE_ENUM
|
|
|
end
|
|
|
- end
|
|
|
+ end
|
|
|
+ field :product_no
|
|
|
#field :category_id
|
|
|
field :product_cat
|
|
|
field :detail
|
|
|
@@ -230,6 +231,7 @@ class Product < ActiveRecord::Base
|
|
|
TYPE_ENUM
|
|
|
end
|
|
|
end
|
|
|
+ field :product_no
|
|
|
#field :category_id
|
|
|
field :product_cat
|
|
|
field :detail
|
|
|
@@ -292,6 +294,7 @@ class Product < ActiveRecord::Base
|
|
|
TYPE_ENUM
|
|
|
end
|
|
|
end
|
|
|
+ field :product_no
|
|
|
#field :category_id
|
|
|
field :merchant_id
|
|
|
field :product_cat
|