mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
47467fe33d
When writing fixtures, it's currently possible to define associations that don't exist, even if a foreign key exists. For example:
```yml
george:
name: "Curious George"
pirate: redbeard
blackbeard:
name: "Blackbeard"
```
When the fixtures are created, `parrots(:george).pirate` will be nil, but it's not immediately clear why. This can make it hard to debug tests and can give false confidence in passing ones.
This can happen because Rails [disables referential integrity](
|
||
---|---|---|
.. | ||
assets | ||
bug_report_templates | ||
rails_guides | ||
source | ||
.document | ||
CHANGELOG.md | ||
rails_guides.rb | ||
Rakefile | ||
w3c_validator.rb |