tallty_import_export 1.0.10 → 1.0.15

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: a04b3934c446e2bbf669f01a5e3db5f5cb898a10be14c46da3388b0d45f11ede
4
- data.tar.gz: f4f1fa8e5cd8d58a52ecd6b82c7547181ee11078c41eeec4a22f4ada037de3c3
3
+ metadata.gz: 06f862bf1ae912a77b1e7a02d76fade118619343de44cbcff2b5f165756ea323
4
+ data.tar.gz: db83a7345b10d91e5018604ed08c24287e085930c96b7af66499d6333464f063
5
5
  SHA512:
6
- metadata.gz: cc7e2b3836f2feebbc23d4844079c57a78b470a7f103d4efd78d456ad4e6b574745668c99054375add3bbc936a62648b0340ab562a977f3b26df4856099a2a9a
7
- data.tar.gz: 8eff47ec5ea1fa31a819c74f13073f23374819c70f7218ecaebbdfb3853fbb07a84f77943d80a0c55b7f8152afaa1cd68b94a207039b8876040ca52f5627ba73
6
+ metadata.gz: ba25061c42d32c4396cbb88b9aae8ef7296b58a306c47037dd5c53cea9bde0d8df29f7ed373463d7f74596f78e73fecf3005aa02a2b449ab9d60f0313631bc63
7
+ data.tar.gz: 240105d66e1c3a009fb8f03b70a19cbb0307c3bbe2e611958e7cd019d332404bae5c75b681488595988996f2bc616aa4e445cc73f6bda6389b4ed55eb81e95ee
@@ -40,11 +40,13 @@ module TalltyImportExport
40
40
  if @group_by.present?
41
41
  if records.is_a?(Array)
42
42
  records.group_by { |record| record.send(@group_by)}.each do |key, group_records|
43
+ next unless key.present?
43
44
  @group_key = key
44
45
  export_workbook workbook, group_records
45
46
  end
46
47
  else
47
48
  records.group(@group_by).count.keys.each do |key|
49
+ next unless key.present?
48
50
  @group_key = key
49
51
  export_workbook workbook, records.ransack("#{@group_where}" => key).result
50
52
  end
@@ -175,7 +177,7 @@ module TalltyImportExport
175
177
  def handle_format data, header
176
178
  case header[:attr_type].to_s
177
179
  when 'string'
178
- date.to_s
180
+ data.to_s
179
181
  when 'datetime'
180
182
  data ? data.strftime('%F %H:%M') : nil
181
183
  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.10"
2
+ VERSION = "1.0.15"
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.10
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - liyijie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 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