codeforamerica/congress — pull request #17 by drinks (2014-04-03 20:45:36+00:00)
Title: Allow string zipcodes in `districts_locate`

This patch lets you get zipcode => district results via `Congress.districts_locate('04344')` rather than `Congress.districts_locate(4344)`. It won't break existing implementations using integer zips, but as zipcodes aren't numbers it's problematic to require them to be provided as such; the default geocode behavior obscures the fact that the call has failed to do what the user expects by geocoding the zip and providing the district of the centroid rather than all intersecting districts.

Bit me in exactly that way and I wanted to make sure it didn't happen to anyone else!