Skip to content

Commit

Permalink
Merge pull request #52 from Obversity/master
Browse files Browse the repository at this point in the history
Improvements to docs for loading multiple items
  • Loading branch information
exAspArk authored Oct 15, 2019
2 parents 4398f93 + 5a6b766 commit 0ef2eed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ BatchLoader.for(post.user_id).batch(default_value: NullUser.new) do |user_ids, l
end
```

For batches where the value is some kind of collection, such as an Array or Hash, `loader` also supports being called with a block, which yields the _current_ value, and returns the _next_ value. This is extremely useful for 1:Many relationships:
For batches where the value is some kind of collection, such as an Array or Hash, `loader` also supports being called with a block, which yields the _current_ value, and returns the _next_ value. This is extremely useful for 1:Many (`has_many`) relationships:

```ruby
BatchLoader.for(user.id).batch(default_value: []) do |user_ids, loader|
Expand Down

0 comments on commit 0ef2eed

Please sign in to comment.