Since you do seem to be defining the rooms table, why not use the rails
'traditional' roomtypes_id field as your key? It is much clearer (I
know what that field is, and I know where it connects to), it is the
'convention over configuration' solution, and it alleviates any
potential issue with someone in the future deciding that "Oh, that room
type name doesn't really fit anymore, can I change it?" - I personally
abhor descriptive strings as keys for precisely that reason...
Leave some of that DB world training behind and embrace the 'rails way',
you'll be much happier, and things tend to fit more naturally.
--
Posted via http://www.ruby-forum.com/.
If that were true, then you'd know that your original schema is not
normalized to 3NF and should not be used for general purposes.
> and have come
> across many models that needs to have multiple keys as prmary and
> foreign. Thus my quest to custom foreign keys.
You don't need custom foreign keys for this. Just normalize your DB
schema properly and you'll most likely get something that Rails can work
with.
> Anyway, the 'magic' rails does is very interesting..
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org