简体   繁体   English

Rails是否在数据库中存储数据关系?

[英]Does rails store data relationships in the database?

When using relationships in rails are they stored in the database so all foreign keys are stored in the tables and such like or are all relationships controlled via the software? 在rails中使用关系时,它们是否存储在数据库中,因此所有外键都存储在表中,诸如此类,还是所有关系都通过软件控制?
Thanks in Advance 提前致谢
Dean 院长

The foreign keys are stored in the tables. 外键存储在表中。 The has_many and belongs_to declarations in the models are only there to create the attributes used to access the relationships. 模型中的has_manybelongs_to声明仅用于创建用于访问关系的属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM