Skip to content

Conversation

tanmay3011
Copy link
Contributor

No description provided.

@matthewd
Copy link
Member

This makes the example disagree with the preceding paragraph, which still says 1000. For the guide, I think it's better to leave the batch size at the default: let's just remove the parameter instead:

Invoice.find_in_batches do |invoices|

Also, let's retain the current active-voice spelling of the comment; that seems more likely to be how it would be written in our theoretical code base.

Thanks for spotting this! 💙

@tanmay3011
Copy link
Contributor Author

@matthewd - Updated! Please have a look at it again.

export.add_invoices(invoices)
end
```

NOTE: The `:include` option allows you to name associations that should be loaded alongside with the models.

##### Options for `find_in_batches`

The `find_in_batches` method accepts the same `:batch_size` and `:start` options as `find_each`, as well as most of the options allowed by the regular `find` method, except for `:order` and `:limit`, which are reserved for internal use by `find_in_batches`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed this before: I think the second half of this sentence (from "as well as") is a lie too.

@tanmay3011
Copy link
Contributor Author

@matthewd - Updated!

matthewd added a commit that referenced this pull request Sep 12, 2014
[ci skip] #find_in_batches doesn't support :include option
@matthewd matthewd merged commit b259b06 into rails:master Sep 12, 2014
@matthewd
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants