Dereferencing product Taxons

This commit is contained in:
Will Marshall
2014-07-11 12:40:49 +10:00
parent ef55bf97c6
commit fecc68cff8
2 changed files with 4 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
Darkswarm.factory 'Product', ($resource, Enterprises) ->
Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) ->
new class Product
constructor: ->
@update()
@@ -18,3 +18,5 @@ Darkswarm.factory 'Product', ($resource, Enterprises) ->
dereference: ->
for product in @products
product.supplier = Enterprises.enterprises_by_id[product.supplier.id]
Dereferencer.dereference product.taxons, Taxons.taxons_by_id

View File

@@ -43,7 +43,7 @@ node :variants do |product|
end
child :taxons => :taxons do |taxon|
attributes :name, :id
attributes :id
end
child :properties => :properties do |property|