Reputation: 5916
I have a Property model that has rooms
and suites
columns.
If I want to find all Properties that have rooms > 5
, I can easily write:
Property.where("rooms > 5")
But I want to write a query that finds any Properties that have +5 rooms and suites
, so it can be 6 rooms and 0 suites
, 0 rooms and 6 suites
, 3 rooms and 3 suites
or any combination. What matters is that rooms + suites > 5
.
How would I write such a query?
Upvotes: 2
Views: 110