Commit Graph

3 Commits

Author SHA1 Message Date
Emmanuel Gautier 0b53d28b4c
Pass index to block for *_list methods
When using one of the `*_list` methods, allow the block to receive array
index for each object:

```ruby
posts = build_list(:post, 10, title: 'Post number') do |post, i|
  post.title = "#{post.title} #{i + 1}"
end

posts.first.title # => "Post number 1"
posts.last.title  # => "Post number 10"
```

A block that only takes in the object still works as before, as does
leaving off the block entirely.

Co-authored-by: Mike Countis <mike.countis@gmail.com>
2020-04-24 11:36:17 -04:00
Hunter Braun 95bd3c6076 [Rubocop] Performance Cop Offenses (#1209) 2018-10-04 21:07:56 -04:00
Avielle c716ce01b4 Replace 'girl' with 'bot' everywhere (#1051)
Also: add a deprecation warning to factory_girl, asking users to switch to
factory_bot

https://github.com/thoughtbot/factory_girl/issues/921
2017-10-20 15:20:28 -04:00