tit*_*coy 1 ruby-on-rails models
在我的数据库中,OptionSets与其他OptionSet相关联.如果我加入两个单独的表,我会创建一个简单的连接表.但是,Rails喜欢将其外键命名为<singular_table_name> _id,即optionset_id.但是,如果我自己加入表,我显然不能给这两个表赋予相同的名称.我该如何处理?
create_table :optionsets_optionsets do |t|
t.column :optionset_id, :integer
t.column :dependent_optionset_id, :integer # how do i deal with this?
endRun Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2472 次 |
| 最近记录: |