Displaying 2 results from an estimated 2 matches for "set_foreign_key".
2007 Oct 07
2
How specify foreign key column name in model?
In a model declaration I can specify the name of the primary key
column with
set_primary_key "CUSTOMER_NUMBER"
How can I set the name of a foreign key column that does not conform
to the RoR naming convention. Does the following work?
set_foreign_key "CUSTOMER_NUMBER"
If not, how can I specify the name of the foreign key column? Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send ema...
2006 Apr 07
6
Foreign Key naming convention override
...model to override the ''id'' naming
convention for the primary key by adding the following to the customers
model.
set_primary_key(:intcustomerid)
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!
Thanks,
Alana
--
Posted via http://www.ruby-forum.com/.