|
@@ -4,6 +4,7 @@ class ProductItem < ActiveRecord::Base
|
|
|
self.table_name = "product_items"
|
|
self.table_name = "product_items"
|
|
|
validates :product_id,:item_id,:nums, presence: true
|
|
validates :product_id,:item_id,:nums, presence: true
|
|
|
validate :product_validation
|
|
validate :product_validation
|
|
|
|
|
+
|
|
|
def product_validation
|
|
def product_validation
|
|
|
if self.product_id > 0
|
|
if self.product_id > 0
|
|
|
prd = Product.where("id = ?", self.product_id).first
|
|
prd = Product.where("id = ?", self.product_id).first
|
|
@@ -25,7 +26,10 @@ class ProductItem < ActiveRecord::Base
|
|
|
self.item_title=prd.name
|
|
self.item_title=prd.name
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
-
|
|
|
|
|
|
|
+ #清空套装缓存
|
|
|
|
|
+ url = "#{CONFIG_FILE["api_host"]}railsadmin/clean_cache/package/#{self.product_id}"
|
|
|
|
|
+ p url
|
|
|
|
|
+ open(url)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
rails_admin do
|
|
rails_admin do
|