Product dependency is fixed
This commit is contained in:
parent
6b05067dc6
commit
8e386f413f
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue