Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Commit

Permalink
Fix association count block example
Browse files Browse the repository at this point in the history
  • Loading branch information
paulelliott committed Jul 15, 2012
1 parent b0b3f09 commit 4e13694
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions views/_content.markdown
Expand Up @@ -109,10 +109,11 @@ You can specify which fabricator to use in that situation as well.
end

You can also generate arrays of objects with the count parameter. The attribute
block receives the object being generated as well as the incrementing value.
block receives the object being generated as well as the incrementing value. It works just like you would expect if you leave off the block.

Fabricator(:person) do
children(count: 3) { |parent, i| Fabricate(:person, parent: parent) }
open_souce_projects(count: 5)
children(count: 3) { |attrs, i| Fabricate(:person, name: "Kid #{i}") }
end

#### Inheritance
Expand Down

0 comments on commit 4e13694

Please sign in to comment.