tallty_import_export 1.0.8 → 1.0.13

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: c7d7ca21a9a6d55f1bb3aaef470e0c683afbaee5302e56f911715f2514cdba9b
4
- data.tar.gz: c9f7b882eecee3883d1e07ef89187a8f8d672251dde4d51a647b5eca072a14ec
3
+ metadata.gz: 44d0cfc1f2d9fda3dae9e82861cdb8e4cad7f7535deedc488b49e487a926b67b
4
+ data.tar.gz: 31514974c3010af2809271f3f0aca99cb5e53e4bd1f00d116601ed9c70cd5711
5
5
  SHA512:
6
- metadata.gz: f829b2d625ce5f10e131ed66f0f7c088c26e9855cd878fd6d27a95e78fbe9931180233624bbfa12d1ee8973be03d9334860f7d265c7dd772e37aa1f696ebf5ec
7
- data.tar.gz: 16461d52726acc91a0eb5af83a942539b6fe70ffd9e47caed5d8bcd48626b7ff8ca3832df5f2232f601f3fc82a70c92ff770de68211e22dfbf630a66e711e30d
6
+ metadata.gz: 0633e13811f7c3e119f8e68e4e0defc0e77e407fc5a4049b97bc17558a4b27713d892ddb117c2105dce96cc5d21f1bf92840d6ee1191a0469385888346ae0143
7
+ data.tar.gz: f34f948a034d20a48d7c921ef3da36809fefc5fda0b6fab0b7997619f0cb0a2eadb597f776a13b1c50cdc28a00768b8da057fdf9f8003d7dc98269d9595a4245
@@ -38,6 +38,7 @@ module TalltyImportExport
38
38
  workbook = pack.workbook
39
39
 
40
40
  if @group_by.present?
41
+ @header = nil # 因为group_by的,基本上都是export_header动态变化的,因此去掉选择
41
42
  if records.is_a?(Array)
42
43
  records.group_by { |record| record.send(@group_by)}.each do |key, group_records|
43
44
  @group_key = key
@@ -174,6 +175,8 @@ module TalltyImportExport
174
175
  # 根据数据类型 attr_type 进行数据的格式化
175
176
  def handle_format data, header
176
177
  case header[:attr_type].to_s
178
+ when 'string'
179
+ data.to_s
177
180
  when 'datetime'
178
181
  data ? data.strftime('%F %H:%M') : nil
179
182
  when 'date'
@@ -51,7 +51,7 @@ module TalltyImportExport
51
51
 
52
52
  def process_options options
53
53
  options = options.with_indifferent_access
54
- @headers = options.delete(:headers) || []
54
+ @headers = options.delete(:headers) || import_headers
55
55
  @primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact
56
56
 
57
57
  @excel_hash = @headers.reduce({}) do |h, header|
@@ -1,3 +1,3 @@
1
1
  module TalltyImportExport
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tallty_import_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - liyijie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-29 00:00:00.000000000 Z
11
+ date: 2021-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zip-zip
@@ -149,8 +149,6 @@ files:
149
149
  - lib/tallty_import_export/import.rb
150
150
  - lib/tallty_import_export/importable.rb
151
151
  - lib/tallty_import_export/version.rb
152
- - tallty_import_export-1.0.3.gem
153
- - tallty_import_export-1.0.5.gem
154
152
  - tallty_import_export.gemspec
155
153
  homepage: https://git.tallty.com/open-source/tallty_import_export
156
154
  licenses:
Binary file
Binary file