Maintaining model relations from old DB into Rails?

55 views Asked by At

I'm taking exported CSV files from an old File Maker Pro DB and redoing in Rails/ActiveRecord. I'm using the Gem 'ActiveRecord-import' to import the CSV files. There are old relations that I've created an attribute for in my new UML creation.

Question: How do I maintain those relations in my new Join tables which will be used for future CRUD? For example: I have Company and Projects. Company has_many Projects through CompanyProject. I'm doing all the importing in my Seed file. If I have an attribute named old_company_id and old_project_id, how do I use those old Id's in my new schema to maintain the relationship?

0

There are 0 answers