-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Factor out handling of filer_id. Add more IEC data. #351
Conversation
state: row['tran_state'], | ||
zip: row['tran_zip4']) | ||
.first_or_initialize | ||
.tap { |p| p.update_attributes(employer: row['tran_emp'], occupation: row['tran_occ']) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here we're creating Party::Individual
records despite the fact that row['entity_cd']
is actually 'Other'. What exactly is this getting us?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a comment. I was fixing this when the other stuff came op. Forgot about it.
The Firemans Union PAC reported all the contributions from members as OTH. That makes them look like a business rather than a person.
On Nov 1, 2014, at 6:30 PM, Tom Dooner [email protected] wrote:
In backend/fetchers/contribution.rb:
# contributor is "Other"
Party::Other.where(name: row['tran_naml'] || 'unknown')
.first_or_initialize
.tap { |p| p.update_attributes(city: row['tran_city'], state: row['tran_state'], zip: row['tran_zip4']) }
when 'IND', 'OTH'
if row['entity_cd'] == 'IND' || !row['tran_namf'].nil? the
# contributor is an Individual
full_name = row.values_at('tran_namf', 'tran_naml', 'tran_nams')
.join(' ')
.strip
Party::Individual.where(name: full_name,
city: row['tran_city'],
state: row['tran_state'],
zip: row['tran_zip4'])
.first_or_initialize
So here we're creating Party::Individual records despite the fact that row['entity_cd'] is actually 'Other'. What exactly is this getting us?.tap { |p| p.update_attributes(employer: row['tran_emp'], occupation: row['tran_occ']) }
—
Reply to this email directly or view it on GitHub.
Cool – I pulled this locally and it seems to work. I didn't see any problems with your code, though using semicolons in Ruby is unnecessary, and so too is the "then" in I'll merge this and deploy it. |
Factor out handling of filer_id. Add more IEC data.
Done. Here's the output when I ran it:
Thanks for adding this stuff. It adds a whole new dimension to the site. |
This should fix #311 issues.
Factor out the handling of filer_id (usually the recipient of a contribution):
There are committee ids which are not integers, map them to unique integers.
Make sure we update pending ids when we find them.
Add the IEC info from form 496
Special case Kaplan, since there is an IEC that matches better than her committee.
Update map.csv (early and often).