Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rails 8 changed the private
ActiveRecord::Batches#build_batch_orderssignature from(order)to(cursor, order)to support composite primary keys:The
IS_RAILS_7_1_PLUSbranch still called the one-arg form, so everypluck_in_batches/pluck_eachcall on an ActiveRecord relation raised:This adds an
IS_RAILS_8_PLUSbranch that passesArray(primary_key)as the cursor. Behaviour is unchanged — both forms produce{ primary_key => :asc }. Rails < 8 paths are untouched.Verified against maxio-com/chargify on the Rails 8 upgrade branch (
fnd-840-rails-8-upgrade, PR #30000), which was failing 22 examples on this error:spec/jobs/batch/backfill_customer_maxioid_spec.rb— 25 examples, 0 failuresspec/lib/jobs/batch/proforma_invoice_pdf_zip_export_spec.rb— 17 examples, 0 failuresAlso exercised the call shapes used across that codebase (single primary key, multi-column, non-primary-key column, string column names,
pluck_each, and a relation with a pre-existingorder) — results and ascending ordering match Rails 7.2.