Results 1 to 2 of 2
Jan 13, 2008, 19:02 #1
- Join Date
- Jan 2008
- 0 Post(s)
- 0 Thread(s)
Table with two foreign keys to the same lookup table
I am new to Ruby, I am trying to use Rails to build a web interface for a legacy engineering database. Problem what I am facing now is that in many cases one table has 2 references to the same lookup table, for example table ValveCatalog has 2 fields: NPSMinKey and NPSMaxKey - references to the same table NPS with primary key NPS_ID. Or another example - each valve has 2 fields for material - body material and bolt material.
The question is - how should I describe this situations in the model, I don't think I can use belongs_to ... any ideas?