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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44d0cfc1f2d9fda3dae9e82861cdb8e4cad7f7535deedc488b49e487a926b67b
|
4
|
+
data.tar.gz: 31514974c3010af2809271f3f0aca99cb5e53e4bd1f00d116601ed9c70cd5711
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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|
|
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.
|
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-
|
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
|