Commit 427fa1d12eb276a9635b4b6e4234513da5922fbe

Authored by Rodrigo Souto
1 parent ad6f7988

Add source to avoid relations

Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
plugins/orders/models/orders_plugin/item.rb
@@ -40,10 +40,10 @@ class OrdersPlugin::Item < ActiveRecord::Base @@ -40,10 +40,10 @@ class OrdersPlugin::Item < ActiveRecord::Base
40 40
41 # FIXME: don't work because of load order 41 # FIXME: don't work because of load order
42 #if defined? SuppliersPlugin 42 #if defined? SuppliersPlugin
43 - has_many :from_products, through: :product 43 + has_many :from_products, through: :product, source: :orders
44 has_many :to_products, through: :product 44 has_many :to_products, through: :product
45 - has_many :sources_supplier_products, through: :product  
46 - has_many :supplier_products, through: :product 45 + has_many :sources_supplier_products, through: :product, source: :items
  46 + has_many :supplier_products, through: :product, source: :enterprise
47 has_many :suppliers, through: :product 47 has_many :suppliers, through: :product
48 #end 48 #end
49 def from_product 49 def from_product