From 881038c92a86783efabf68b525ad1e6c9f9d1bf3 Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Wed, 18 Jan 2017 11:14:12 +0000 Subject: [PATCH] Remove the unnecessary LegislativePeriodExtension#people_ids method Thanks to @tmtmtmtm for pointing out that the people method can be much simpler, making the people_ids method unnecessary. --- lib/everypolitician_extensions.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/everypolitician_extensions.rb b/lib/everypolitician_extensions.rb index 74f424ca7..c8ef4d70d 100644 --- a/lib/everypolitician_extensions.rb +++ b/lib/everypolitician_extensions.rb @@ -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