Preserve Arel expressions across query boundaries - #591
Merged
Merged
Conversation
nertzy
force-pushed
the
arel/expression-boundaries
branch
from
September 7, 2026 15:05
eb178d7 to
69aebc8
Compare
nertzy
force-pushed
the
arel/expression-boundaries
branch
from
September 7, 2026 17:39
69aebc8 to
b7eac02
Compare
nertzy
force-pushed
the
arel/expression-boundaries
branch
from
September 7, 2026 17:44
b7eac02 to
a98d3db
Compare
nertzy
force-pushed
the
arel/expression-boundaries
branch
2 times, most recently
from
September 7, 2026 18:32
3d1215f to
dd5704f
Compare
nertzy
force-pushed
the
arel/expression-boundaries
branch
from
September 7, 2026 18:55
dd5704f to
eff2975
Compare
Keep attributes intact during normalization and reject unsupported inputs instead of treating Ruby inspection text as SQL. Preserve trusted String input and quoted-value nodes. Carry default rank, association primary keys, and internal joins as nodes. Keep custom ranking SQL and the bind-safe legacy String join adapter.
nertzy
force-pushed
the
arel/expression-boundaries
branch
from
September 7, 2026 20:46
eff2975 to
c47e272
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.
Keep expressions as Arel nodes across normalization, ranking, and association joins instead of rendering and wrapping them again.
Normalizer previously recognized node subclasses but not Arel attributes, which are separate objects. Passing an attribute turned its Ruby inspection into SQL. Preserve attributes alongside nodes, retain trusted String SQL input, and reject unsupported objects rather than silently stringifying them.
The default rank now remains an expression. Association exposes an Arel join consumed directly by scope construction, allowing scoped bind values to travel through Active Record's collector. The existing String join adapter still renders through the unprepared path, and custom ranking/ordering SQL remains supported.
Public examples exercise attribute normalization, node-based joins, NULL aggregation, scoped conditions containing quotes, and the legacy String adapter. The empty-source tsearch fragment remains unchanged: removing it changes existing failure behavior and would require a separate validation decision.
Continues above #590 without changing the earlier review heads.