ndr_import 11.0.0 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 52ae4b12ab514a7bda584c93b3124fdeab03cea5292424c0e380c92f6e3a3c1a
4
- data.tar.gz: 4b9dff76aa434bb87e542bcf694d4f99a91b2cd69e2eeaf6730a32b78fe61cc9
3
+ metadata.gz: 8b3b3b485a77caed57442e97c7391c4d95b68ee4a9ae5af1a6e53b9a1fd95987
4
+ data.tar.gz: fbf1799920b70ddcbc6014c269e90a6d3d9689f01a306042ab2cac7152637eff
5
5
  SHA512:
6
- metadata.gz: 27e3c4578ab466ae9977727de5b972e8e5bf7e2f9fa62ab53cd60437e4d7232e5da3ce3afbcf6b94dd943b219b051ccc6177b73189e736ecf8d10f582f6f0bc9
7
- data.tar.gz: b06ef69bba53f56314574ff9749011289180624d0f73f7660537610ba29e3ec01114810bc781ccb8c67440c30f1406a05c56e508299a026a7467bb7968d4cb16
6
+ metadata.gz: b06f9293e925ef74ecb96a1ae24f7732bf057ff6642a29245ad99f51b6bd48d608257575c48a2bbe89a509de1f9db44a457567175e9f3a354840f48fe5d1e92c
7
+ data.tar.gz: 37c8145eea0bb9f6f1788f202524cd233a7b542088b7d540f5d7d236ca910dcaf950ffd0adf6a4619afb64a6f4b7082c478d90a4b7bf19dba8016b6ab3fba07b
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  =======
3
3
  *no unreleased changes*
4
4
 
5
+ ## 11.0.1 / 2023-10-30
6
+ ### Fixed
7
+ * Ensure autogenerated XML column mappings are unique
8
+
5
9
  ## 11.0.0 / 2023-10-27
6
10
  ### Changed
7
11
  * XML enhancements. Breaking change, the enhancements are not backward compatible
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # This stores the current version of the NdrImport gem
3
3
  module NdrImport
4
- VERSION = '11.0.0'
4
+ VERSION = '11.0.1'
5
5
  end
@@ -57,19 +57,19 @@ module NdrImport
57
57
  end
58
58
  end
59
59
 
60
- # Append "_1", "_2" etc to repeating rawtext and optionally mapped field names within a
61
- # single record, so data is not overwritten
60
+ # Append "_1.1", "_2.1", "_1" etc to repeating rawtext and optionally mapped field names
61
+ # within a single record, so data is not overwritten
62
62
  def apply_new_rawtext_and_mapped_names_to(new_column)
63
63
  existing_rawtext = existing_column['rawtext_name'] || existing_column['column']
64
64
  column_name_increment = new_column['column'].scan(/\[(\d+)\]/)
65
65
  relative_path_increment = new_column.dig('xml_cell', 'relative_path').scan(/\[(\d+)\]/)
66
66
 
67
- # Find all the increments (e.g. [1], [2]) from the new column and use their sum
68
- # as the rawtext and column name increment
69
- increment = (column_name_increment + relative_path_increment).flatten.map(&:to_i).sum
70
- new_column['rawtext_name'] = existing_rawtext + "_#{increment}" unless increment.zero?
67
+ # Find all the increments (e.g. [1], [2]) from the new column and concatenate them to
68
+ # use as the rawtext and column name increment
69
+ increment = (column_name_increment + relative_path_increment).flatten.compact.join('.')
70
+ new_column['rawtext_name'] = existing_rawtext + "_#{increment}" if increment.present?
71
71
 
72
- return unless !increment.zero? && increment_field_name
72
+ return unless increment.present? && increment_field_name
73
73
 
74
74
  new_column['mappings'] = incremented_mappings_for(new_column, increment)
75
75
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ndr_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.0.0
4
+ version: 11.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - NCRS Development Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-27 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel