I have a project where users can search for results within a specified distance of their location, e.g. within 10 miles of their postcode. I am using geokit-rails for this and it works great using the simple:
.within(@distance, :origin => @latlng)
However there are some results that are not dependant on location so I would like them to always appear in the search, this will be denoted by a bit property called 'remote' set to 1 if it should be included.
So what I need to do is be able to search for all results where the Distance is less than X OR remote equals 1.
Is there any way to do this, or will I have to make 2 db calls and merge the results?
Many thanks