Skip to content

Commit

Permalink
PersonCard: get top_identifiers from term instead
Browse files Browse the repository at this point in the history
This is now directly available from the LegislativePeriod object (called
'term') so there's no need to pass it to the initializer.
  • Loading branch information
mhl committed Jan 26, 2017
1 parent 881038c commit 595f5b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/page/term_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def people
PersonCard.new(
person: person,
term: term,
top_identifiers: top_identifiers
)
end
end
Expand Down
11 changes: 6 additions & 5 deletions lib/person_cards.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# frozen_string_literal: true

class PersonCard

# TODO: pass fewer arguments!
def initialize(person:, term:, top_identifiers:)
def initialize(person:, term:)
@person = person
@term = term
@top_identifiers = top_identifiers # get from Legislature
end

def proxy_image
Expand Down Expand Up @@ -48,7 +45,11 @@ def memberships

private

attr_reader :person, :term, :top_identifiers
attr_reader :person, :term

def top_identifiers
term.top_identifiers
end

def legislature
term.legislature
Expand Down

0 comments on commit 595f5b6

Please sign in to comment.