Hello all, Does a generator exist to generate the ActiveRecord model from the database? I wouldn''t mind if it generated parent-child relations always as has_many - belongs_to. The scenario in my case is a database of about 180 legacy tables, with a pattern that the foreign keys use (<parent table name>_OID). These I''d like to wrap in the model as easily as possible without having to type it in all myself, lazy bum that I am *g* Cheers and thanks in advance for any hints and pointers, Florian
> Does a generator exist to generate the ActiveRecord model from the > database? > I wouldn''t mind if it generated parent-child relations always as > has_many - belongs_to. > > The scenario in my case is a database of about 180 legacy tables, > with a pattern that the foreign keys use (<parent table name>_OID). > These I''d like to wrap in the model as easily as possible without > having to type it in all myself, lazy bum that I am *g* > > Cheers and thanks in advance for any hints and pointers,In situations like this I have often used a spreadsheet to "write" the code. Just use some complicated function to concat a bunch of repetative strings together inserting the name of the table where necessary. Voila instant results. Similar results are possible using SQL and of course some ruby/perl scripting Ed W