Product dependency is fixed

This commit is contained in:
benji 2015-02-04 16:49:19 +01:00
parent 6b05067dc6
commit 8e386f413f

View file

@ -19,6 +19,11 @@ class OrderProduct < ActiveRecord::Base
accepts_nested_attributes_for :product
def product_attributes=(attributes)
self.product = Product.find(attributes[:id])
super
end
private
def remove_from_stock