On Tue, Dec 27, 2005 at 02:21:49PM -0500, Francois B. wrote:
} Hi !
} 2005/12/27, Farooq [email protected]:
} > Not sure if this is implied in the documentation or something
} > does the RoR framework require “every table must have an id” ? If
} > is the case, then what happened to the concept of normalization ?
} > Futher, if the tables have already been build for an existing
} > appication ( without ID column in everytable ) , will the script /
} > generate work ?
} Yes, all tables need an ID or equivalent column. It need not be
} called ID (see #set_primary_key
} Normalization only ensures that the customer’s address is not repeated
} in more than one table. That’s why we use IDs to get at the
} customer’s record.
} Never tried it myself, but script/generate scaffold should work with
} your existing tables. You will need to change the generated models to
} set your primary key, though.
Is there support for multi-column keys? I have a situation in which the
most reasonable schema has a table with a two-column key: the pairing of
foreign key and an ordering value. It is a simple has_many situation,
there is no reason to interact with records of the model outside the
dependent has_many collection.
} Hope that helps !
} Fran??ois Beausoleil