I am looking for a tool or a method which can convert my huge old database to active records model definitions ... like reverse engineering ...
This is less a reverse engineering problem and more a "does your legacy database adhere to the active record conventions" problem. Most do not and from my experience, it's almost easier to do some migration work on the data end to get it in a state such that it does adhere to those conventions. Rails is a very opinionated piece of software, the less you argue with it, the happier you'll be.
My two cents...
Sorry I don't know a tool either. But creating an active record model is really simple as meager showed it. Additionally you may have to describe the table name and the primary key:
class Artikelgruppe < ActiveRecord::Base
set_table_name "tblArtGrp"
set_primary_key "ArtGrpID"
end
As my Rails application uses only a small subset of our legacy database I prefer to create views specific to the needs of my application in the database. I have really problems to describe a join over eg 7 models in Rails but it is really easy to create a view for joining 7 tables in the database.
Why do the Rails people still think they are the centrum of the universe? I have a dozen applications written in different languages and the common ground is the database. Imagine I would have to change the database to make Rails happy ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With