alexreisner/geocoder — pull request #692 by switzersc (2014-08-10 21:58:21+00:00)
Title: add alternate attributes options for near_scope_options

I have models with multiple sets of coordinates that I wanted to query on easily. For example, I needed to be able to query User.near based on its latitude/longitude, last_login_latitude/last_login_longitude, etc, so I added optional arguments :alternate_latitude and :alternate_longitude to the options hash in near_scope_options to be able to query on different columns on my users table. So:

User.near("Omaha, NE", 5, alternate_latitude: :last_login_latitude, alternate_longitude: :last_login_longitude)