I have a suburbs activerecord that belongs to a city and have many listings, I want to get the listings where the suburb city is a given value.
listings = Listing.joins(:suburbs).where('listings.updated_at >= ?', 2.months.ago).where('city_id = ?', city_id)