Skip to content

Commit

Permalink
Remove the unnecessary LegislativePeriodExtension#people_ids method
Browse files Browse the repository at this point in the history
Thanks to @tmtmtmtm for pointing out that the people method can be
much simpler, making the people_ids method unnecessary.
  • Loading branch information
mhl committed Jan 26, 2017
1 parent 4c12a77 commit 881038c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/everypolitician_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ def memberships_at_end
end
end

def people_ids
@people_ids ||= Set.new(memberships.map(&:person_id))
end

def people
@people ||= legislature.popolo.persons.select do |p|
people_ids.include?(p.id)
end
@people ||= memberships.map(&:person).uniq(&:id)
end

def top_identifiers
Expand Down

0 comments on commit 881038c

Please sign in to comment.