lib/whereabouts_methods.rb
def set_validators klass, fields=[]
      _single = validate_singleton_for(klass)
      klass.to_s.camelize.constantize.class_eval do
        fields.each do |f|
          validates_presence_of f, 
            :if => lambda {|a| a.addressable_type.constantize.send(_single).include?(f)}
        end
      end
    end
def set_validators klass, fields=[]
      _single = validate_singleton_for(klass)
      klass.to_s.camelize.constantize.class_eval do
        fields.each do |f|
          validates_presence_of f, 
            :if => lambda {|a| a.addressable_type.constantize.send(_single).include?(f)}
        end
      end
    end
Sets validates_presence_of fields for the Address based on the
 singleton method created on the Address addressable_type class.