在我的数据库中,OptionSet 与其他 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?
end