activerecord-hackery / ransack

Object-based searching.
https://activerecord-hackery.github.io/ransack/
MIT License
5.66k stars 799 forks source link

Predicate to search by length of string #1492

Open Tobias-Knudsen opened 4 months ago

Tobias-Knudsen commented 4 months ago

I have a rails API using ransack to filter results. I want to be able to query by the length of the string eg. I want to find all records where attribute a's length is less than a desired value.

name_length_lteq: 4 => should return all records with the name of 4 or less characters.