Permalink
Browse files

Handle multiple name and email fields

  • Loading branch information...
tmtmtmtm committed Oct 18, 2017
1 parent 0953ef2 commit ca0175a979e750f9ecd652b43427243951cbd97d
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/member_page.rb
View
@@ -4,15 +4,15 @@
class MemberPage < FolketingPage
field :name do
box.css('h1').text.tidy
box.css('h1').map(&:text).map(&:tidy).first
end
field :constituency do
raw_memberships.first.to_s[/ in (.*?) from/, 1].to_s.sub('greater constituency', '').tidy
end
field :email do
box.css('div.person a[href*="mailto:"]/@href').text.gsub('mailto:', '').tr('|/', ';')
box.css('div.person a[href*="mailto:"]/@href').map(&:text).map { |e| e.gsub('mailto:', '').tr('|/', ';') }.uniq.join(';')
end
field :homepage do

0 comments on commit ca0175a

Please sign in to comment.