- Make sure to require 'rubygems' <-- I forget that part a lot for some reason.
- You MUST set ActiveRecord::Base#logger to an instance of the any Logger class. ActiveRecord won't take care of setting ActiveRecord::Base#logger to an empty dummy class -- you'll get a bunch of Nil-based errors if you forget this.
- ActiveRecord::Base#establish_connection --> takes the same parameters you'll find in a database.yml.
- If you want to mess with SQL Server, make sure to grab the latest adapter: gem install activerecord-sqlserver-adapter.
- If your legacy table is a_details, the ActiveRecord model will be ADetail.
- If you want to access the column RelationID, it is ADetail#RelationID <-- easy.
- If your legacy DB has a wonky naming scheme for primary keys (and it will), you need to use set_primary_key in your ActiveRecord model.
Happy sailing, yo.
UPDATE:
For the LOVE OF GOD don't forget gotapi -- it is a big bucket of win.
No comments:
Post a Comment