|
|
@@ -3,7 +3,7 @@ class ProductItem < ActiveRecord::Base
|
|
|
has_paper_trail
|
|
|
self.table_name = "product_items"
|
|
|
validates :product_id,:item_id,:nums, presence: true
|
|
|
- validate :order_validation
|
|
|
+ validate :product_validation
|
|
|
def product_validation
|
|
|
if self.product_id > 0
|
|
|
prd = Product.where("id = ?", self.product_id).first
|