Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_nth
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
3
Merge Requests
3
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
Ngô Trung Hưng
venjob_nth
Commits
ba6efd34
Commit
ba6efd34
authored
Aug 05, 2020
by
Ngô Trung Hưng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
validate relationship
parent
4c77e3c8
Pipeline
#812
failed with stages
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
lib/csv/jobs.csv
+0
-0
lib/service/import_data.rb
+6
-8
No files found.
lib/csv/jobs.csv
View file @
ba6efd34
This source diff could not be displayed because it is too large. You can
view the blob
instead.
lib/service/import_data.rb
View file @
ba6efd34
...
@@ -43,14 +43,12 @@ class ImportData
...
@@ -43,14 +43,12 @@ class ImportData
industry_name
=
val
[
'category'
].
gsub
(
','
,
'/'
).
gsub
(
'/'
,
' / '
)
industry_name
=
val
[
'category'
].
gsub
(
','
,
'/'
).
gsub
(
'/'
,
' / '
)
industry
=
Industry
.
find_or_create_by
(
name:
industry_name
.
strip
)
industry
=
Industry
.
find_or_create_by
(
name:
industry_name
.
strip
)
Job
.
find_or_create_by
(
name:
val
[
'name'
],
Job
.
find_or_create_by
(
name:
val
[
'name'
],
company_id:
company_id
)
do
|
job
|
company_id:
company_id
,
job
.
level
=
val
[
'level'
]
level:
val
[
'level'
],
job
.
salary
=
val
[
'salary'
]
salary:
val
[
'salary'
],
job
.
description
=
desc
description:
desc
)
do
|
job
|
job
.
city_ids
.
blank?
?
job
.
cities
<<
city
:
job
.
cities
==
city
job
.
create_date
=
Time
.
now
job
.
industry_ids
.
blank?
?
job
.
industries
<<
industry
:
job
.
industries
==
industry
job
.
cities
<<
city
job
.
industries
<<
industry
end
end
rescue
StandardError
=>
e
rescue
StandardError
=>
e
logger
.
error
"Import_jobs:
#{
e
}
"
logger
.
error
"Import_jobs:
#{
e
}
"
...
...
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