Is there a way to have a table with two references to the another table
using two fields?
Here is what I mean. I have two tables, items and billofmaterials:
item (which is an item in ITEMS table)
component (which is also an item in ITEMS table)
For a single record of BILLOFMATERIALS, both of the fields "item" and
"component" are items from the ITEMS table. In my html and such I
would like to call the equivalent of:
But I can not due to ROR naming conventions. Rather, I need to create
my BILLOFMATERIALS table like:
item_id (to reference the ITEMS table)
...thus allowing me to call:
But how can I do the same for the "component" field in BILLOFMATERIALS,
as I certainly can not have two fields called "item_id".