我希望客户参考两种地址模型,一种用于账单地址,另一种用于发货地址.据我所知,外键是由它的名称决定的,即_id.显然,我不能命名两行地址_id(以引用地址表).我该怎么做?
create_table :customers do |t|
t.integer :address_id
t.integer :address_id_1 # how do i make this reference addresses table?
# other attributes not shown
end