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
0
Merge Requests
0
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
Huỳnh Thiên Phước
venjob
Commits
c0fe253d
Commit
c0fe253d
authored
Aug 10, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change logic job_parser
parent
529cabcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
lib/src/job_parser.rb
+4
-6
No files found.
lib/src/job_parser.rb
View file @
c0fe253d
...
...
@@ -35,18 +35,16 @@ class JobParser
location_relationship
=
row
.
css
(
'div.map p a'
).
children
.
map
{
|
name_city
|
name_city
.
text
.
strip
}
cities_relationship
=
City
.
where
(
name:
location_relationship
)
city_job_relationship
=
CityJob
.
where
(
job_id:
job
.
id
,
city_id:
cities_relationship
.
ids
)
if
city_job_relationship
.
blank?
job
.
cities
<<
cities_relationship
end
job
.
cities
<<
cities_relationship
if
city_job_relationship
.
blank?
end
def
industry_relationship
(
row
,
job
)
industry_relationship
=
row
.
css
(
'li a'
).
children
.
map
{
|
name_industry
|
name_industry
.
text
.
strip
}
industries_relationship
=
Industry
.
where
(
name:
industry_relationship
)
industry_job_relationship
=
IndustryJob
.
where
(
job_id:
job
.
id
,
industry_id:
industries_relationship
.
ids
)
if
industry_job_relationship
.
blank?
job
.
industries
<<
industries_relationship
end
job
.
industries
<<
industries_relationship
if
industry_job_relationship
.
blank?
end
def
create_job
(
title
,
link_page
,
row
,
company
)
...
...
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