1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[ci skip] #find_in_batches doesn't support :include option

This commit is contained in:
tanmay3011 2014-09-12 17:14:24 +05:30
parent 516f431ab0
commit 2e51d6f917

View file

@ -340,16 +340,14 @@ The `find_in_batches` method is similar to `find_each`, since both retrieve batc
```ruby ```ruby
# Give add_invoices an array of 1000 invoices at a time # Give add_invoices an array of 1000 invoices at a time
Invoice.find_in_batches(include: :invoice_lines) do |invoices| Invoice.find_in_batches do |invoices|
export.add_invoices(invoices) export.add_invoices(invoices)
end end
``` ```
NOTE: The `:include` option allows you to name associations that should be loaded alongside with the models.
##### Options for `find_in_batches` ##### 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`. The `find_in_batches` method accepts the same `:batch_size` and `:start` options as `find_each`.
Conditions Conditions
---------- ----------