You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search by an attribute path instead of a table-qualified string
searchable_columns built "table.column" strings, which is why the Mongoid
adapter had to take them apart again in parse_collection_name and guess whether
the prefix named a collection or an embedded path -- the clearest case of a
field deciding how a query gets built.
Return a Criteria::Path wherever the configuration can be read as one, and let
each adapter resolve it: ActiveRecord qualifies with the associated table and
reads that half back out for the relation's references, Mongoid keeps grouping
conditions by collection and still reaches embedded documents by field path.
Configurations naming a table or a model class stay strings and are handed
through, since their prefix is not an association name:
searchable 'teams.name'
searchable({leagues: :name})
searchable(League => :name)
searchable_columns remains the option adapters read, so overriding it with
strings keeps working.
Field specs now assert the path, which is what the field owes; what each of them
compiles to is pinned in the ActiveRecord adapter spec, where the previous
strings are reproduced exactly.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments