Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tallty_import_export
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
tallty_import_export
Commits
efc2555a
Commit
efc2555a
authored
Feb 02, 2021
by
Ivan Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 导出支持 headers 传入
parent
690b3080
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
export.rb
lib/tallty_import_export/export.rb
+3
-6
No files found.
lib/tallty_import_export/export.rb
View file @
efc2555a
...
...
@@ -28,7 +28,7 @@ module TalltyImportExport
def
export_xlsx
records
,
**
options
records
=
with_scope
records
exportable_default
s
(
options
)
process_option
s
(
options
)
options
=
options
.
with_indifferent_access
...
...
@@ -90,7 +90,7 @@ module TalltyImportExport
end
end
def
exportable_default
s
options
=
{}
def
process_option
s
options
=
{}
options
=
options
.
with_indifferent_access
@row_height
||=
options
.
delete
(
:row_height
)
||
35
...
...
@@ -98,16 +98,13 @@ module TalltyImportExport
@filename
||=
options
.
delete
(
:filename
)
@group_by
||=
options
.
delete
(
:group_by
)
@group_where
=
"
#{
@group_by
}
_eq"
if
@group_by
.
present?
@headers
||=
options
.
delete
(
:headers
)
end
def
with_scope
records
records
end
def
headers
=
val
@headers
=
val
.
map
{
|
header
|
header
.
with_indifferent_access
}
end
def
export_headers
@headers
||
klass
.
try
(
:headers
)
||
klass
.
try
(
:model_headers
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment