aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/batches
Commit message (Collapse)AuthorAgeFilesLines
* Changed options for find_each and variants to have options start/finish ↵Vipul A M2016-01-181-6/+6
| | | | | | instead of start_at/end_at based on comments at https://github.com/rails/rails/pull/12257#issuecomment-74688344
* Add ActiveRecord::Relation#in_batchesSina Siadat2015-08-071-0/+67
`in_batches` yields Relation objects if a block is given, otherwise it returns an instance of `BatchEnumerator`. The existing `find_each` and `find_in_batches` methods work with batches of records. The new API allows working with relation batches as well. Examples: Person.in_batches.each_record(&:party_all_night!) Person.in_batches.update_all(awesome: true) Person.in_batches.delete_all Person.in_batches.map do |relation| relation.delete_all sleep 10 # Throttles the delete queries end