Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
Overview
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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
da4165f8
Commit
da4165f8
authored
Jul 07, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix continue row error when import csv
parent
105faa0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lib/import/csv_reader.rb
+8
-7
No files found.
lib/import/csv_reader.rb
View file @
da4165f8
...
@@ -13,10 +13,10 @@ class Import::CSVReader
...
@@ -13,10 +13,10 @@ class Import::CSVReader
def
import
def
import
@logger
.
info
(
'Start read data'
)
@logger
.
info
(
'Start read data'
)
puts
'=======Start read data======='
puts
'=======Start read data======='
begin
csv_text
=
File
.
read
(
@file
)
csv_text
=
File
.
read
(
@fil
e
)
csv
=
CSV
.
parse
(
csv_text
,
headers: :tru
e
)
csv
=
CSV
.
parse
(
csv_text
,
headers: :true
)
csv
.
each
do
|
row
|
csv
.
each
do
|
row
|
begin
# Job type information
# Job type information
job_type
=
import_job_type
(
row
)
job_type
=
import_job_type
(
row
)
...
@@ -37,10 +37,11 @@ class Import::CSVReader
...
@@ -37,10 +37,11 @@ class Import::CSVReader
# Job Category Information
# Job Category Information
import_job_category
(
job
,
category
)
import_job_category
(
job
,
category
)
rescue
StandardError
=>
e
logger
.
error
(
e
.
message
)
logger
.
error
(
e
.
backtrace
)
next
end
end
rescue
StandardError
=>
e
logger
.
error
(
e
.
message
)
logger
.
error
(
e
.
backtrace
)
end
end
puts
'=======End read data======='
puts
'=======End read data======='
@logger
.
info
(
'End read data'
)
@logger
.
info
(
'End read data'
)
...
...
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