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
580ad00f
Commit
580ad00f
authored
Feb 07, 2021
by
liyijie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add valid? for import method
parent
efc2555a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
import.rb
lib/tallty_import_export/import.rb
+7
-0
No files found.
lib/tallty_import_export/import.rb
View file @
580ad00f
...
...
@@ -67,6 +67,8 @@ module TalltyImportExport
line_info
=
convert_data
(
line_info
)
# 处理每行对于导入的动作,处理line_info
return
unless
valid?
(
line_info
)
import_record
(
line_info
,
associations
)
context
.
last_line_info
=
line_info
end
...
...
@@ -89,6 +91,11 @@ module TalltyImportExport
end
.
with_indifferent_access
end
# 通过转换后,数据是否合法,如果不合法,则直接跳过不处理这个数据
def
valid?
line_info
true
end
def
import_headers
klass
.
try
(
:headers
)
||
klass
.
try
(
:model_headers
)
||
(
raise
ArgumentError
.
new
(
'missing import_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