Foreign keys in Rails 3

后端 未结 3 1816
离开以前
离开以前 2021-02-08 08:17

I understand that according to Rails philosophy, data integrity checks should be done at the application level as opposed to the database level. Like many other developers, I en

3条回答
  •  甜味超标
    2021-02-08 08:58

    I found myself asking the same question the other day, so I did some research and collated my findings in an answer to an older but similar Stack Overflow question. I hope that's of use.

    BTW, when you say that you "enthusiastically disagree" that data integrity checks should be done at the application level as opposed to the database level, I assume you mean that they should be done at both levels, rather than just at the database. I hope I'm right in thinking that virtually everyone agrees that having integrity checks at the application level is a Good Thing, and that the only topic being debated is whether they should additionally be done in the database.

提交回复
热议问题