lib/cocina/models/mapping/from_mods/contributor.rb in cocina-models-0.93.0 vs lib/cocina/models/mapping/from_mods/contributor.rb in cocina-models-0.93.1
- old
+ new
@@ -35,11 +35,11 @@
end
def build
grouped_altrepgroup_name_nodes, other_name_nodes = AltRepGroup.split(nodes: deduped_name_nodes)
check_altrepgroup_type_inconsistency(grouped_altrepgroup_name_nodes)
- contributors = grouped_altrepgroup_name_nodes.map { |name_nodes| build_name_nodes(name_nodes) } + \
+ contributors = grouped_altrepgroup_name_nodes.map { |name_nodes| build_name_nodes(name_nodes) } +
other_name_nodes.map { |name_node| build_name_nodes([name_node]) }
contrib_level_type_and_status(contributors)
adjust_primary(contributors.compact).presence
end
@@ -108,10 +108,10 @@
else
[role_node]
end
end
- result.each { |_k, role_nodes| role_nodes.uniq! { |role_node| name_node_comparitor(role_node) } }
+ result.each_value { |role_nodes| role_nodes.uniq! { |role_node| name_node_comparitor(role_node) } }
end
def check_altrepgroup_type_inconsistency(grouped_altrepgroup_name_nodes)
grouped_altrepgroup_name_nodes.each do |altrepgroup_name_nodes|
altrepgroup_name_types = altrepgroup_name_nodes.group_by { |name_node| name_node['type'] }.keys