Open chrismytton opened 7 years ago
Ah sorry, it was actually https://github.com/everypolitician/everypolitician-ruby/pull/67 that introduced the change.
So reading through #67 it seems that was the expected behaviour at the time of the change, but I know that @octopusinvitro bumped into the unexpected behaviour I described above last week, so worth having an issue here to at least discuss this :)
Problem
https://github.com/everypolitician/everypolitician-ruby/commit/5e6d24da92399ac884a3024cbefb1d2df608db89https://github.com/everypolitician/everypolitician-ruby/pull/67 changed the way theEverypolitician::Legislature#latest_term
works. Before that commit it was returningEveryPolitician::LegislativePeriod
instances, but it's now returningEveryPolitician::Popolo::LegislativePeriod
instances.This is unexpected behaviour because
EveryPolitician::LegislativePeriod
represents a legislative period stanza incountries.json
whereasEveryPolitician::Popolo::LegislativePeriod
represents an legislative period "event" in the legislature's popolo.Proposed solution
Revert this method to have the previous behaviour. The only way you should be able to access ep-popolo objects is by going through the
#popolo
method of anEverypolitician::Legislature
instance.Acceptance criteria
Calling
Everypolitician::Legislature#latest_term
should return an instance ofEveryPolitician::LegislativePeriod
.