lib/whereabouts_methods.rb
def set_geocoding klass
      _single = geocode_singleton_for(klass)
      klass.to_s.camelize.constantize.class_eval do
        geocoded_by :geocode_address
        after_validation :geocode, 
          :if => lambda {|a| a.addressable_type.constantize.send(_single) && (a.new_record? || a.changed?)}
      end
    end
def set_geocoding klass
      _single = geocode_singleton_for(klass)
      klass.to_s.camelize.constantize.class_eval do
        geocoded_by :geocode_address
        after_validation :geocode, 
          :if => lambda {|a| a.addressable_type.constantize.send(_single) && (a.new_record? || a.changed?)}
      end
    end
Geocode the address using Address#geocode_address if the
 geocode_singleton is true and the record is either new or
 has been updated.