Created
August 25, 2008 06:21
-
-
Save HamptonMakes/7033 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @parser.lookup(:location) do |name, operator, value| | |
| location = PreferredLocation.find_by_name(value) | |
| if operator == "name" | |
| tolerance = 1 | |
| else | |
| tolerance = 0 | |
| end | |
| ["((preferred_locations.lat between ? and ?) AND (preferred_locations.lon between ? and ?))", location.lat - tolerance, location.lat + tolerance, location.lon - tolerance, location.lon + tolerance] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment