OpenCongress Person returning nil #5

Merged
merged 5 commits into from Jun 23, 2011

Conversation

Projects
None yet
2 participants
Contributor

NateBarnes commented Jun 21, 2011

After establishing a connection to OpenCongress, I attempted to draw Person objects through several methods (find, senators_most_in_the_news_this_week, etc). After checking to ensure the api was returning proper JSON, and stepping through the process, I noticed that there was a problem in the Person.new method.

Also I noticed there were no tests for the OpenCongress section of GovKit, so I created the basic structure for them following the style laid out in OpenStates. I also added tests for this problem.

Let me know if there's anything else needed. Thanks!

Contributor

NateBarnes commented Jun 21, 2011

Upon further reflection, the original problem appears to lie in MRI's instance_methods method. In 1.8 (which I assume this was written under), it returned an array of strings. Under 1.9 it returns an array of symbols. So the objects were loading with nils under 1.9. My first commit did the opposite, and had it loading nils under 1.8. The current one should fix both.

This is likely an issue with the other OpenCongressObjects as well. I'll likely look at refactoring them this evening. Thanks!

Contributor

NateBarnes commented Jun 21, 2011

Last update on this issue, I promise :)

Went ahead and DRYed up the code a bit by moving the param loading into the parent class, so they should all be 1.8 & 1.9 compatible now.

@ghost ghost pushed a commit that referenced this pull request Jun 23, 2011

OpenGovernment Merge pull request #5 from NateBarnes/master
OpenCongress Person returning nil
f847da4

@ghost ghost merged commit f847da4 into opengovernment:master Jun 23, 2011

@mrmax99 mrmax99 added a commit to mrmax99/govkit that referenced this pull request Aug 14, 2014

@mrmax99 mrmax99 Adjusted open congress issue #5 fix to work with newer versions of ru…
…by than 1.9
65a1983
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment