Assume you have a Bicycle model with an array attribute components. To find all bicyles which have the component disc_brakes in the components array, use the following query:
Bicyle.where("'disc_brakes'=ANY(components)")Mar 13, 2026
Assume you have a Bicycle model with an array attribute components. To find all bicyles which have the component disc_brakes in the components array, use the following query:
Bicyle.where("'disc_brakes'=ANY(components)")