Kuang
Thanks for this
I am reading through the "blackbook" on Rails and various web resources. I should start to be able to produce something concrete in a month or so. It would be an interesting exercise to try and migrate a legacy DB such as Pracsoft to a rails DB. If the DB schema is known this should be possible using a Ruby script.

R

kuang oon wrote:

Hi Richard,
If you follow the rails method, your program would take off by following these 2 quick steps : 1) almost always name your sql tables in the plural form e,g. transactions, items, patients etc 2) change your directory to the appropriate application folder, then execute: script/generate scaffold Transaction Accountant This will generate the model (named in the singular form of the table name by convention) called Transaction as the table is named Transactions, and the controller called Accountant. in this instance.... and away you go with the basic CRUD already set up for you once you launch webbrick.
HTH
Kuang
Idiosyncratic in search of a village.
On 20/10/2006, at 4:04 PM, Horst Herb wrote:


On Friday 20 October 2006 15:44, Richard Hosking wrote:

Doesnt RoR have a method to convert singular names to plural? In this
case it seems better to use the singular.


autogenerated models assume plural
you can manually override it with the table statement to any name you choose
(eg for legacy database integration)

As always in RoR - convention over configuration. You can ignore the
convention whenever you like at the price of having to add configuration
information manually

PS: there is a RoR gem called db_discovery or similar, from memory) which you can point at legacy databases and it just goes through and automatically
generates all models and migration code from introspection and  metadata
analysis - regardless of tablenames etc.

Horst
_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk


_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

_______________________________________________
Gpcg_talk mailing list
[email protected]
http://ozdocit.org/cgi-bin/mailman/listinfo/gpcg_talk

Reply via email to