codeforamerica / MuniciPal

:speech_balloon: Consulting city-dwellers about legislation near them.
22 stars 14 forks source link

addresses_controller.rb should be refactored #32

Closed tbuckl closed 10 years ago

tbuckl commented 10 years ago

@techieshark do we need to grab an imaginary point, and then reverse geocode it?

it seems like all we strictly need to do is geocode. i'm not even sure why we reverse geocode.

so maybe we just strip addresses_controller.rb down to a geocode call.

and then move all of the other stuff to the /council_district.rb controller. because all its really doing now in the arcgis branch is e.g. CouncilDistrict.find(6).

tbuckl commented 10 years ago

also, right now we make an inDistrict? call and then a getDistrict call. can you recall why we need both of those? shouldn't an empty District in getDistrict just tell us its not inDistrict? this results in calling arcgis twice.

techieshark commented 10 years ago

shouldn't an empty District in getDistrict just tell us its not inDistrict? this results in calling arcgis twice.

That seems like a better way to do it, yes.

techieshark commented 10 years ago

it seems like all we strictly need to do is geocode. i'm not even sure why we reverse geocode.

Yeah, refactoring that controller could result in cleaner code. Let's talk about it tomorrow.

tbuckl commented 10 years ago

i think maybe we can close this now

techieshark commented 10 years ago

I have a little bit more that improves this...

tbuckl commented 10 years ago

this is way better now. thanks @techieshark