dynamic table names for Active Record models

后端 未结 7 1432
感情败类
感情败类 2021-01-27 13:25

I have an interesting Active Record problem and I\'m not quite sure what the cleanest solution is. The legacy database that I am integrating with has a strange wrinkle in its sc

7条回答
  •  萌比男神i
    2021-01-27 13:42

    Why not simply put all the wheels in one table and use a standard :has_many? You can do it in a migration:

    1. create new wheels table
    2. migrate data from other tables to the newly created table
    3. delete the old tables

提交回复
热议问题