I have a model with a one_to_many relationship to another model such that:
user.area_ids = [1, 2, 3]
And then another model that shares the relationship but is a one to one.
listing.area_id = 1
How do I query for all the listings that are either area_id of 1 2 or 3. I am hoping to do something like...
Listing.where("area_id IN ?", user.area_ids)
But that doesn't work.
Any help would be appreciated!
user.area_ids.join(',')where(field: [1,2,3])just fine.