The document model belongs_to :user if the DOCUMENTS table has a user_id foreign key column.
如果 DOCUMENTS 表有一个 user_id 外键列,则文档模型为 belongs_to :user。
The <many-to-many> tag's column attribute specifies the foreign key column in the link table that relates the link table to the mapping table for the target class.
<many-to-many>标签中的column属性用来指定连接表与目标类的映射表链接的外键。
Listing 5 adds a trail and a location to the database, managed with a foreign key pointing from the location_id column in trails to the id column in locations.
清单5向数据库添加了一条赛道和一个地点,由从trails中的location_id列指向locations中的id列的外键管理。
应用推荐