Module: Filterable::Target
- Defined in:
- lib/filterable/target.rb
Overview
Resolves declared targets: a bare column on the model itself, or a nested one-key hash walking associations to a column on the associated model (+{ account: { bank: :name } }+). Association filtering joins the declared path and merges the condition on the target model, adding DISTINCT when the path crosses a collection.
A polymorphic association — a delegated_type — is crossed by naming the
concrete type as the second segment: { attachable: { bank: :name } }
joins the concrete table and guards on the *_type column. The hop must
open the path and target a column directly on the concrete type.
An unresolvable target — unknown association, unguarded polymorphic reflection, unknown concrete type, ambiguous multi-key hash — narrows nothing.