diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-08-14 17:32:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 17:32:48 -0400 |
commit | 0864735d81f211a26864b113321e648b01726619 (patch) | |
tree | 2831c7d07fc6e1851932a2c1f10c9cfaeda54949 /activerecord/lib | |
parent | 1e73c1d4f74bcca05f4691465e8482cce8a3fdb9 (diff) | |
parent | 7afde4bbd229f4055182b59aa34aa51f8c35f146 (diff) | |
download | rails-0864735d81f211a26864b113321e648b01726619.tar.gz rails-0864735d81f211a26864b113321e648b01726619.tar.bz2 rails-0864735d81f211a26864b113321e648b01726619.zip |
Merge pull request #30236 from padi/find-each-example-update
Completes ActiveRecord::Batches.find_each example [ci skip]
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/relation/batches.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/batches.rb b/activerecord/lib/active_record/relation/batches.rb index 141ad176ea..fa19c679cf 100644 --- a/activerecord/lib/active_record/relation/batches.rb +++ b/activerecord/lib/active_record/relation/batches.rb @@ -47,7 +47,12 @@ module ActiveRecord # handle from 10000 and beyond by setting the +:start+ and +:finish+ # option on each worker. # - # # Let's process from record 10_000 on. + # # In worker 1, let's process until 9999 records. + # Person.find_each(finish: 9_999) do |person| + # person.party_all_night! + # end + # + # # In worker 2, let's process from record 10_000 and onwards. # Person.find_each(start: 10_000) do |person| # person.party_all_night! # end |