From 356e95c009a3108e99182d8666de9e36facf3380 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Sat, 20 Dec 2014 15:07:11 -0800 Subject: Add note about the association between the two fixture files and how they're connection. [ci skip] --- guides/source/testing.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'guides/source') diff --git a/guides/source/testing.md b/guides/source/testing.md index 98bf901bb7..42b493fb73 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -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 -- cgit v1.2.3