lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb in adiwg-mdtranslator-2.13.0 vs lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb in adiwg-mdtranslator-2.13.1

- old
+ new

@@ -21,32 +21,32 @@ def self.build(hCitation) citation = '' # names - aIndexes = [] + aParties = [] hCitation[:responsibleParties].each do |hResponsibility| role = hResponsibility[:roleName] hResponsibility[:parties].each do |hParty| party = {} party[:role] = role - party[:index] = hParty[:contactIndex] - aIndexes << party - hParty[:organizationMembers].each do |hMember| + party[:contactId] = hParty[:contactId] + aParties << party + hParty[:organizationMembers].each do |memberId| party = {} party[:role] = role - party[:index] = hMember[:contactIndex] - aIndexes << party + party[:contactId] = memberId + aParties << party end end end - aIndexes.uniq! - aIndexes.each do |hIndex| - hContact = ADIWG::Mdtranslator::Writers::SbJson.get_contact_by_index(hIndex[:index]) + aParties.uniq! + aParties.each do |hParty| + hContact = ADIWG::Mdtranslator::Writers::SbJson.get_contact_by_id(hParty[:contactId]) unless hContact.empty? unless hContact[:name].nil? - sbRole = Codelists.codelist_adiwg2sb('role_adiwg2sb', hIndex[:role]) - sbRole = sbRole.nil? ? hIndex[:role] : sbRole + sbRole = Codelists.codelist_adiwg2sb('role_adiwg2sb', hParty[:role]) + sbRole = sbRole.nil? ? hParty[:role] : sbRole citation += hContact[:name] + '(' + sbRole + '), ' end end end