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](
|
||
---|---|---|
.. | ||
mysql2_specific_schema.rb | ||
oracle_specific_schema.rb | ||
postgresql_specific_schema.rb | ||
schema.rb | ||
sqlite_specific_schema.rb |