Explorar el Código

增加订单导入功能

abiao hace 4 años
padre
commit
98a110d65c
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      app/models/order_detail.rb

+ 1 - 2
app/models/order_detail.rb

@@ -7,9 +7,8 @@ class OrderDetail < ActiveRecord::Base
   # has_one :order, :foreign_key=>:order_id, :primary_key=>:order_id
   validates :order_no,:product_id,:nums, presence: true
   validate :order_validation
-  after_import :import_orders
 
-  def import_orders
+  def self.after_import
     # 获取商品信息
     pd = Product.where("id = ?", self.product_id).first
     detail = OrderDetail.where("id = ?", self.id).first