Skip to content

Commit

Permalink
fix org/adress converting in HashConvertor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew2net committed Sep 20, 2021
1 parent 4fab3a9 commit 9106c9c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/relaton_bib/hash_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def org_hash_to_bib(org)
org[:subdivision] = array(org[:subdivision]).map do |sd|
LocalizedString.new sd
end
org[:contact] = contacts_hash_to_bib(org)
org
end

Expand Down Expand Up @@ -256,10 +257,10 @@ def affiliation_hash_to_bib(person) # rubocop:disable Metrics/AbcSize, Metrics/M
end
end

def contacts_hash_to_bib(person) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
return [] unless person[:contact]
def contacts_hash_to_bib(entity) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
return [] unless entity[:contact]

array(person[:contact]).map do |a|
array(entity[:contact]).map do |a|
if a[:city] || a[:country]
RelatonBib::Address.new(
street: Array(a[:street]), city: a[:city], postcode: a[:postcode],
Expand Down

0 comments on commit 9106c9c

Please sign in to comment.