Displaying 1 result from an estimated 1 matches for "component_of".
Did you mean:
component_0
2008 Apr 09
3
help with model relationship for Product/Bill of Materials
...oduct'',
:foreign_key=>''component_id''
validates_numericality_of :quantity
----
So for a product p, I can have:
bom=p.bom_items
item=bom[0] etc
and for each item I can have:
c=item.component (which is a product)
Now for c I would like to be able to ask
c.component_of
at the moment, I can only think to set up a product method
Perhaps that is the best way to do it, but I just feel I am not
modeling this in the best way. I also want to make sure a product
cannot have a bom and be a component in the same bom - since that is
circular
If any experts in data mode...