Skip to content

Commit

Permalink
Merge pull request #24 from shinyaK14/fix_readme
Browse files Browse the repository at this point in the history
Fix 1:Many example in README.md
  • Loading branch information
exAspArk authored Aug 31, 2018
2 parents 6730dfa + da12d34 commit 1f0048b
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 @@ -295,7 +295,7 @@ 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:

```ruby
BatchLoader.for(user.id).batch(default_value: []) do |comment_ids, loader|
BatchLoader.for(user.id).batch(default_value: []) do |user_ids, loader|
Comment.where(user_id: user_ids).each do |comment|
loader.call(comment.user_id) { |memo| memo << comment }
end
Expand Down

0 comments on commit 1f0048b

Please sign in to comment.