How to check if a number is within range in activerecord?
Clash Royale CLAN TAG #URR8PPP How to check if a number is within range in activerecord? I have a model with a range column #<JobRequirement id: 1, age: 18...30> How can I get the JobRequirement using an age: 20 ? JobRequirement age: 20 Something like JobRequirement.where(age: 20) Which database and what type is age inside the database? – mu is too short 11 hours ago age It is int4range in postgreSQL – Brian Law 11 hours ago 1 Answer 1 I think you need to use the PostgreSQL range operators and a bit of SQL in a string. In particular, you'd want the @> (contains element) operator: @> JobRequ...