所以,我刚刚发现rails不支持关于外键的引用完整性,并且相当惊讶.那么,管理这个的最佳方法是什么?是否存在处理参照完整性的“轨道”方式? 理想情况下,应用程序不应该处理所有这
理想情况下,应用程序不应该处理所有这些;数据库应该.我正在寻找像外国人一样的插件.我想知道这种方法是否有一些缺点.这通常如何处理轨道?
这是Rails ActiveRecord的设计决定.I consider stored procedures and
constraints vile and reckless
destroyers of coherence. No, Mr.
Database, you can not have my business
logic. Your procedural ambitions will
bear no fruit and you’ll have to pry
that logic from my dead, cold
object-oriented hands.
Choose a single layer of cleverness – DHH
所以答案是DB处理的引用完整性根本不是Rails方式.