Rails - how to make Geocoder "near" query with "where" condition?
I am working with the Geocoder gem and there is mentioned this snippet for
searching records within a distance:
Venue.near('Omaha, NE, US', 20)
This is working well, but I would need to add another condition. This is
the query I currently use:
Car.where('car.status = ? AND listings.sold IS ?', 1,
nil).includes(:images, :user)
And to this query I am trying to add the near call, like this:
Car.near('90013', 20).('car.status = ? AND listings.sold IS ?', 1,
nil).includes(:images, :user)
But result of this query is just nil.
What is the correct way to combine near query with where condition?
No comments:
Post a Comment