5

We are in the process of migrating our CRM app built using (JBoss AS, JDBC, Hibernate, MySQL) into Rails 3.2.x

We would like to keep the database schema as it is, so that we have minimal effort while we move into a new web architecture with Rails. Are there any tools which will help me generate the models/controllers and handle migrations from a database perspective.

What strategy should we use so that we can keep the old application humming in production before we move to the newer Rails app.

4

1 回答 1

3

Here is what I think, and what I have done the same past :)

1 - first write the models coupling with your existing DB (I think you are using ActiveRecord with Rails , if not you should :D)

2 - Try your level best to use ActiveRecord and its components, avoid using pure SQL, because later that will create a mess

3 - cover with good unit tests and make sure your models are working with existing DB and all the relations etc.

4 - then move to the controller and view layer

5 - Golden rule, try to keep Rails conventions as much as possible, because the beauty of rails is that, if you follow the rails way things will "just work"

(Since you are using the same database you will not have the headache of data migration).

And +1 migrating from Java to Ruby :)

于 2012-12-31T10:53:34.273 回答