Bug fix for empty names in items

This commit is contained in:
Dan Milne
2019-10-24 12:58:13 +11:00
parent 5a7b39b0bf
commit 674848ccb9
3 changed files with 186 additions and 0 deletions

View File

@@ -55,6 +55,13 @@ module Paapi
end
def contributors_of(kind)
contributors&.select { |e| e['Role'] == kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.capitalize } }&.map do |e|
r = e['Name']
Nameable(r) unless r.to_s.empty?
end.compact
end
def contributors_of1(kind)
contributors&.select { |e| e['Role'] == kind.to_s.gsub(/([[:alpha:]]+)/) { |w| w.capitalize } }&.map { |e| Nameable(e['Name'])}
end