tallty_import_export 1.0.30 → 1.0.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d508c090e1c1bf676c46ae3bb2d3d2d0c9d3e4d123853894a668262d9ac27ee
4
- data.tar.gz: 2f6fee166e44b4e82015a1419da3b7aaad57e71880e26ddcfdfa9fe97cf61572
3
+ metadata.gz: 8fc8d251f5c43b1e6e7aaf423043ea169502a7333efef9812da5eb30569dcc9f
4
+ data.tar.gz: 0b207ea6ccd23e1fc154f80bec5a64683e2fb6aaa908bf48d24e0c979fdbba84
5
5
  SHA512:
6
- metadata.gz: 96486980954a1b12f804bbebf6c6bcd1e75ebf191b39cf4e22dfc11b36a4bed21502555b1bc8cce413e2ac1285cfdb360435d505f899e5db1b3c19d5ce09eeb0
7
- data.tar.gz: 6951da2e23d352e485c28a56b13c03d2789ea4bed2a4ae79207dfebcfa1a8543e70143e8eb68bfd04814cf245ea2c47493468672d4418570049b36af79ee3427
6
+ metadata.gz: 974b43f19133ca3a956298134e93e30e8d0bead9095957d909cfcad91ed8b601855465c4d227b0bfa4bf5f9c88c006c0a6cb1bbc078b6fffb944a36808b9b252
7
+ data.tar.gz: 05deb4675a3ad28ee2f492ba89e61deebbe363229c7d24c5233a36f9c49852ed60debb10ef49790265e8b38607039b24d0e5e63e8fa2875d9f68048a2b370b1f
@@ -110,8 +110,16 @@ module TalltyImportExport
110
110
  true
111
111
  end
112
112
 
113
+ # 需要合并proc,前端没有办法把proc传过来
113
114
  def import_headers_result
114
- @headers ||= import_headers&.with_indifferent_access
115
+ import_header_hash = import_headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
116
+ @headers.map do |header|
117
+ key = header[:key]
118
+ if import_header_hash.fetch(key)&.fetch(:proc).present?
119
+ header[:proc] = import_header_hash.fetch(key)&.fetch(:proc)
120
+ end
121
+ header
122
+ end
115
123
  end
116
124
 
117
125
  def import_options
@@ -156,7 +164,7 @@ module TalltyImportExport
156
164
  _record = associations.find_or_initialize_by(line_info.clone.extract!(*primary_keys))
157
165
  _record.update!(line_info.clone.except!(*primary_keys, *@skip_keys))
158
166
  else
159
- associations.create!(line_info)
167
+ associations.create!(line_info.clone.except!(*@skip_keys))
160
168
  end
161
169
  end
162
170
  end
@@ -1,3 +1,3 @@
1
1
  module TalltyImportExport
2
- VERSION = "1.0.30"
2
+ VERSION = "1.0.31"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tallty_import_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.30
4
+ version: 1.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - liyijie