hammyhamhams/Reciprocity — Issue #29: Record Volunteer's lng/lat in their table
Author: hammyhamhams
Created: 2012-01-17 01:25:25+00:00
State: open

Need to think about this; do we use the location they provide as a volunteer, or do we their record ip address? Either way, we consequently record long/lat in the volunteers

Volunteer belongs_to User User has_one Volunteer
Volunteer belongs_to Location Location has_one Volunteer

don't even need to do this if we make volunteer have a location, since locations geocodes for address already.

Volunteers ->

geocoded_by :ip_address,
:latitude => :lat, :longitude => :lon
after_validation :geocode, :if => lambda{ |obj| obj.address_changed? }