-
Notifications
You must be signed in to change notification settings - Fork 5
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
Do not pass popolo data to wikidata page #14849
Do not pass popolo data to wikidata page #14849
Conversation
arr.push( { name: person.name, | ||
wikidata_identifier: wikidata_identifier, | ||
wikidata_url: wikidata_url | ||
} |
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.
I don't think we need to collapse this down to our own data structure here — it's fine just to pass in a list of EveryPolitician::Person
objects
bf60429
to
1426853
Compare
|
||
def people_with_and_without_wikidata | ||
@with_and_without_array ||= popolo.persons.partition(&:wikidata) | ||
{ with: @with_and_without_array[0], without: @with_and_without_array[1] } |
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.
it seems a little needless to convert this to a hash here, rather than just calling people_with_and_without_wikidata.first
or .last
in the public methods.
@@ -1,4 +1,5 @@ | |||
# frozen_string_literal: true | |||
require_relative '../popolo_helper' |
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.
why did you need to add this? I can't see anything that should require it, and removing it doesn't cause any obvious failure.
960e4ea
to
1c473f8
Compare
andrea = '0eedf2c9-01ea-44f4-bc6e-e5e4bf6d2add' | ||
subject.popolo.persons.find_by(id: andrea).wikidata.must_equal 'Q493950' | ||
it 'should pass a list of people with wikidata' do | ||
res = subject.people_with_wikidata.select { |p| p[:name] == 'Cornelia Ecker' } |
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.
Straggling [:name]
rather than .name
. This might be clearer, though, as
subject.people_with_wikidata.map(&:name).must_include 'Cornelia Ecker'
Yay! 👍 There are a lot of VCR cassettes here that I don't think are needed, but I want to squash these commits down a bit first anyway, so I'll clean those out whilst I'm doing that. |
223e19f
to
9448aec
Compare
9448aec
to
8f56c64
Compare
HouseWikidata now passes two arrays. One is a list of people with wikidata, the other is a list of people without.
Closes #14839