Skip to content

Commit

Permalink
Merge branch 'aebirim/website-631_dynamic_guids_for_houses' of https:…
Browse files Browse the repository at this point in the history
…//github.com/ukparliament/parliament-ruby into aebirim/website-631_dynamic_guids_for_houses
  • Loading branch information
EBIRIM authored and EBIRIM committed Mar 6, 2017
2 parents 619e42b + a6d5275 commit c57255c
Show file tree
Hide file tree
Showing 15 changed files with 444 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/parliament/decorators/house_incumbency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ def contact_points
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/parliament/decorators/incumbency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def contact_points
end
end
end
end
end
4 changes: 4 additions & 0 deletions lib/parliament/decorators/party.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def name
def party_memberships
respond_to?(:partyHasPartyMembership) ? partyHasPartyMembership : []
end

def member_count
respond_to?(:count) ? count : nil
end
end
end
end
3 changes: 1 addition & 2 deletions lib/parliament/decorators/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def seats
return @seats unless @seats.nil?

seats = []
incumbencies.each do |incumbency|
seat_incumbencies.each do |incumbency|
seats << incumbency.seat if incumbency.respond_to?(:seat)
end

Expand Down Expand Up @@ -91,7 +91,6 @@ def gender_identities
def gender
gender_identities.empty? ? nil : gender_identities.first.gender
end

end
end
end
4 changes: 3 additions & 1 deletion lib/parliament/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def sort_by(*parameters)
grom_nodes = @nodes.dup
grom_nodes.delete_if { |node| rejected << node unless parameters.all? { |param| node.respond_to?(param) } }
grom_nodes.sort_by! do |node|
parameters.map { |param| node.send(param) }
parameters.map do |param|
node.send(param).is_a?(String) ? I18n.transliterate(node.send(param)).downcase : node.send(param)
end
end

rejected.concat(grom_nodes)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c57255c

Please sign in to comment.