Skip to content

Instantly share code, notes, and snippets.

@davetapley
Created January 22, 2013 21:35
Show Gist options
  • Save davetapley/4598660 to your computer and use it in GitHub Desktop.
Save davetapley/4598660 to your computer and use it in GitHub Desktop.
def self.within_distance_from(*args)
return Place.within_distance_from_place args[0], args[1] if args.length == 2
return Place.within_distance_from_point args[0], args[1], args[2] if args.length == 3
raise ArgumentError, 'Call with either a Place or latitude, longitude; and distance'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment