Using Rails 3.2.2
and ruby 1.9.3dev
and mysql
I am new to ruby ββand rails. We have an existing database with several hundred tables. We would like to try the rails to see if this will be a positive change from PHP and ZendFramework.
Migrating data to another database is not an option for us, since we are currently using this database. We wanted to βattachβ a rails project to an existing database.
The part I'm struggling with spawns all the models from our existing database.
I saw a couple of old posts talking about some automated methods, including the Magic Model Generator . While others said that there is no way to do this, or you just created them all manually.
I was unable to create models using the Magic Model Generator (maybe only rails 2)
Once upon a time, when we switched to ZendFramework, I wrote a quick script to analyze the database and create all the model files for us. It would seem that this will be a somewhat common scenario.
Note. We use ID
instead of ID
, and many of them have many foreign_key
relationships.
So, I wanted to ask the community which is better (way / practice) to handle this?
source share