提交 356e95c0 编写于 作者: Z Zachary Scott

Add note about the association between the two fixture files and how they're connection.

[ci skip]
上级 6925c146
......@@ -98,6 +98,8 @@ one:
category: about
```
Notice the `category` key of the `one` article found in `fixtures/articles.yml` has a value of `about`. This tells Rails to load the category `about` found in `fixtures/categories.yml`.
Note: For associations to reference one another by name, you cannot specify the `id:`
attribute on the fixtures. Rails will auto assign a primary key to be consistent between
runs. If you manually specify an `id:` attribute, this behavior will not work. For more
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册