aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/batches.rb
Commit message (Collapse)AuthorAgeFilesLines
* Remove all cases of manuallly wrapping `Arel::Nodes::Quoted`Sean Griffin2014-12-291-19/+4
| | | | | | | | | | This is no longer required now that we are injecting a type caster object into the Arel table, with the exception of uniqueness validations. Since it calls `ConnectionAdapter#type_cast`, the value has already been cast for the database. We don't want Arel to attempt to cast it further, so we need to continue wrapping it in a quoted node. This can potentially go away when this validator is refactored to make better use of `where` or the predicate builder.
* Inform Arel we don't need additional type casting in batchesSean Griffin2014-12-261-1/+6
| | | | | | | Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
* Inform Arel that we don't need additional type casting in batchingSean Griffin2014-12-261-2/+8
| | | | | | | Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
* We don't need to type cast the offset in `find_in_batches`Sean Griffin2014-12-261-1/+5
| | | | | | | Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
* Clarity start parameterMichael Dawson2014-12-191-2/+2
| | | | | | I find that `Specifies the starting point for the batch processing.` does not give enough information for me to understand what this parameter actually does.
* Clarify that batching methods can be used with any orderable type primary ↵Isaac Seymour2014-12-031-4/+4
| | | | key, not just integer ones, as per @a58cafeb3a86be46849de57481b6644094fb8165
* remove blank lines in the start of the ActiveRecord filesPonomarev Nikolay2014-07-291-1/+0
|
* Return sized enumerator from Batches#find_eachMarc-Andre Lafortune2014-02-051-1/+3
|
* Return sized enumerator from Batches#find_in_batchesMarc-Andre Lafortune2014-02-051-4/+9
|
* find_in_batches should not mutate its argumentMarc-Andre Lafortune2014-01-291-2/+2
|
* Merge pull request #13201 from marcandre/find_in_batch_enumeratorRafael Mendonça França2014-01-291-0/+9
|\ | | | | | | | | | | | | | | `find_in_batches` now returns an `Enumerator` Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/batches.rb
| * `find_in_batches` now returns an `Enumerator` when called without a block, ↵Marc-Andre Lafortune2013-12-061-0/+9
| | | | | | | | | | | | so that it can be chained with other `Enumerable` methods.
* | Mention find_each in find_in_batches doc [ci skip]Marc-Andre Lafortune2014-01-291-0/+2
| |
* | Fail early with "Primary key not included in the custom select clause" in ↵Alexander Balashov2014-01-211-5/+2
|/ | | | | find_in_batches Before this patch find_in_batches raises this error only on second iteration. So you will know about the problem only when you get the batch size threshold.
* `skiping` => `skipping`Vipul A M2013-09-171-1/+1
|
* Merge pull request #11161 from dmitry/find_in_batches_works_without_loggerCarlos Antonio da Silva2013-06-281-2/+2
|\ | | | | | | | | ActiveRecord find_in_batches should work without logger When I set logger to nil both methods from Batches module find_in_batches or find_each should work anyway.
| * find_in_batches should work without loggerDmitry Polushkin2013-06-281-2/+2
| |
* | When .find_each is called without a block, return an Enumerator.Ben Woosley2013-06-191-2/+13
|/ | | | This lets us do things like call: .find_each.with_index
* lists the options for find_each and find_in_batchesThiago Pinto2013-06-071-17/+37
|
* using Model.all.find_each in rails 3 raises an error and should not be ↵Thiago Pinto2013-06-071-2/+2
| | | | recommended
* Fix find_in_batches against string IDs when start option is not specified.Alexis Bernard2012-10-311-2/+2
|
* Fix typo: 'this also mean' -> 'this also means'Jeffrey Hardy2012-10-081-1/+1
|
* start could be a stringSantiago Pastorino2012-09-211-1/+1
| | | | | Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and eb876c4d07130f15be2cac7be968cc393f959c62
* Revert "Fix find_in_batches with customized primary_key"Santiago Pastorino2012-09-211-7/+6
| | | | | | | This reverts commit 761bc751d31c22e2c2fdae2b4cdd435b68b6d783. This commit wasn't fixing any issue just using the same table for different models with different primary keys.
* Fix find_in_batches with customized primary_keyToshiyuki Kawanishi2012-09-161-6/+7
|
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* Deprecate Relation#all.Jon Leighton2012-07-271-1/+1
| | | | | | It has been moved to active_record_deprecated_finders. Use #to_a instead.
* Update batches docsOscar Del Ben2012-07-171-6/+6
|
* copy edit the batches docs [ci skip]Vijay Dev2012-05-301-9/+7
|
* Adds to Batch processing documentation [ci skip]Alvaro Pereyra2012-05-281-9/+20
|
* move code out to active_record_deprecated_findersJon Leighton2012-04-131-7/+2
|
* We need to recorder here. Need to drop the order from default scope.Arun Agrawal2011-09-051-1/+1
| | | Fixes #2832
* Merge pull request #1807 from caius/find_in_batches_id_bugSantiago Pastorino2011-07-141-2/+5
|\ | | | | Bugfix by stopping find_in_batches using the records after yielding.
| * Stop find_in_batches using the records after yielding.Caius Durling2011-06-211-2/+5
| | | | | | | | | | | | Currently if the code that calls .find_in_batches modifies the yielded array in place then .find_in_batches can enter an infinite loop searching with ruby object ids in the database instead of the primary key of records in the database. This happens because it naively assumes the yielded array hasn't been modified before calling #id on the last object in the array. And ruby (1.8 at least) alias' #id to #object_id so an integer is still returned no matter what the last object is. By moving finding the #id of the last object before yielding the array it means the calling code can do whatever it wants to the array in terms of modifying it in place, and .find_in_batches doesn't care.
* | Make `ActiveRecord::Batches#find_each` to not return `self`.knapo2011-07-071-2/+0
|/ | | | This caused that `find_each` was producing extra db call taking all the records from db, and was less efficient than `ActiveRecord::Base#all`.
* Quote find_in_batches ORDER BY clause [#6620 state:resolved]Andrew White2011-03-291-1/+1
|
* Fix Typos: remove several occurences of the theNicholas Rowe2011-02-171-1/+1
|
* ActiveRecord::Relation#primary_key should return a string, just like ↵Jon Leighton2011-01-031-3/+3
| | | | ActiveRecord::Base.primary_key does.
* un-nodocs AR::BatchesXavier Noria2010-09-211-1/+1
|
* avoid method_missing and reduce method callsAaron Patterson2010-09-101-1/+1
|
* call to_a since we are not passing anything to all()Aaron Patterson2010-08-041-1/+1
|
* fisting indentationAaron Patterson2010-08-041-3/+3
|
* Improve code from 231d7676f72947bae765b9bd885b134aaf949921Pratik Naik2010-05-091-7/+5
|
* corrected AR find_each and find_in_batches to raise when the user uses ↵Josh Kalderimis2010-05-091-1/+8
| | | | | | select but does not specify the primary key Signed-off-by: José Valim <jose.valim@gmail.com>
* Warn scoped order and limit are ignored. [#4123 state:resolved]Emilio Tagua2010-03-291-1/+5
|
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-281-0/+2
|
* Move batch finders to RelationPratik Naik2010-02-121-0/+78