Build multisearch rebuild statements with Arel - #587
Open
nertzy wants to merge 1 commit into
Open
Conversation
nertzy
force-pushed
the
arel/multisearch
branch
4 times, most recently
from
September 7, 2026 18:32
5c113f8 to
cb06a0f
Compare
Replace SQL token substitution with an INSERT/SELECT expression, reusing column text casting and NULL handling. Preserve raw-table scans, STI predicates, polymorphic types, and a shared creation/update timestamp. Exercise real rebuilt documents and custom hooks with concise schemas while keeping the established SQL rendering coverage.
nertzy
force-pushed
the
arel/multisearch
branch
from
September 7, 2026 18:55
cb06a0f to
afdd2bb
Compare
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.
Construct the multisearch bulk INSERT/SELECT with Arel instead of replacing placeholders in a SQL template.
Reuse column text-casting and NULL-coalescing expressions, project document fields from the raw model table, and build STI predicates as nodes. Preserve the single timestamp used for both creation and update, quoted identifiers, polymorphic type, and the existing custom, conditional, dynamic, and additional-attribute rebuild paths.
Replace brittle SQL goldens and mock-heavy rebuild examples with assertions on actual inserted documents. The camel-case and custom-primary-key scenarios now exercise real records on the intended schema; fallback examples prove rebuilding rather than merely observing documents created by callbacks.
This completes the multisearch portion of the Arel conversion. Subsequent cleanup PRs address separate query-expression boundaries.