lib/metanorma/standoc/merge_bibitems.rb in metanorma-standoc-2.6.0 vs lib/metanorma/standoc/merge_bibitems.rb in metanorma-standoc-2.6.1

- old
+ new

@@ -45,11 +45,11 @@ end merge_relations(old, new) end def merge_simple(old, new, field) - new[field].blank? and return + (new[field].nil? || new[field].empty?) and return old[field] = new[field] end # ensure return value goes into extent[0] def merge_extent(old, new) @@ -75,15 +75,13 @@ end # @old.field is an array, overwrite only those array elements # where @old.field[attribute] = @new.field[attribute] def merge_by_type(old, new, field, attributes, opt = {}) - new.nil? || new[field].blank? and return + new.nil? || new[field].nil? || new[field].empty? and return old.nil? and return new[field] - if !old[field].is_a?(::Array) || old[field].empty? + !old[field].is_a?(::Array) || old[field].empty? and return old[field] = new[field] - end - old[field] = merge_by_type1(old, new, field, attributes, opt) end def merge_by_type1(old, new, field, attributes, opt) old1 = array_to_hash(old[field], attributes)