Skip to content

Build multisearch rebuild statements with Arel - #587

Open
nertzy wants to merge 1 commit into
arel/featuresfrom
arel/multisearch
Open

Build multisearch rebuild statements with Arel#587
nertzy wants to merge 1 commit into
arel/featuresfrom
arel/multisearch

Conversation

@nertzy

@nertzy nertzy commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

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.

@nertzy
nertzy force-pushed the arel/multisearch branch 4 times, most recently from 5c113f8 to cb06a0f Compare September 7, 2026 18:32
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant