I am working with an existing database and have to keep all table and
field names as they are. ‘tblcustomers’ and ‘tblitems’ are linked by the
‘tblcustomers’ id field ‘tblcustomersid’. In ‘tblitems’, the foreign key
is called ‘txtcustomerid’.
I have already set the customers model to override the ‘id’ naming
convention for the primary key by adding the following to the customers
How do I tell rails to override the preferred name for the foreign key
‘txtcustomerid’? I have tried:
set_foreign_key(:intcustomerid) and :foreign_key => "intcustomerid"
but neither work. I’m running out of ideas!