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
033e166f
Commit
033e166f
authored
Aug 14, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix code crawler
parent
566e2225
Pipeline
#912
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
10 deletions
+8
-10
app/models/city.rb
+1
-1
app/models/company.rb
+1
-1
app/models/industry.rb
+1
-1
app/models/job.rb
+1
-1
lib/src/crawler.rb
+4
-6
No files found.
app/models/city.rb
View file @
033e166f
...
...
@@ -13,6 +13,6 @@ class City < ApplicationRecord
private
def
set_converted_name
converted_name
=
convert_attribute
(
name
)
self
.
converted_name
=
convert_attribute
(
name
)
end
end
app/models/company.rb
View file @
033e166f
...
...
@@ -6,6 +6,6 @@ class Company < ApplicationRecord
private
def
set_converted_name
converted_name
=
convert_attribute
(
name
)
self
.
converted_name
=
convert_attribute
(
name
)
end
end
app/models/industry.rb
View file @
033e166f
...
...
@@ -10,6 +10,6 @@ class Industry < ApplicationRecord
private
def
set_converted_name
converted_name
=
convert_attribute
(
name
)
self
.
converted_name
=
convert_attribute
(
name
)
end
end
app/models/job.rb
View file @
033e166f
...
...
@@ -32,7 +32,7 @@ class Job < ApplicationRecord
private
def
set_converted_name
converted_name
=
convert_attribute
(
title
)
self
.
converted_name
=
convert_attribute
(
title
)
end
end
lib/src/crawler.rb
View file @
033e166f
...
...
@@ -23,13 +23,11 @@ class Crawler
data_city
.
each
do
|
name_city
|
if
City
.
find_by
(
id:
70
)
city
=
City
.
find_or_create_by!
(
name:
name_city
)
do
city
.
update!
(
location:
VIETNAM
)
end
city
=
City
.
find_or_create_by!
(
name:
name_city
)
city
.
update
(
location:
VIETNAM
)
else
city
=
City
.
find_or_create_by!
(
name:
name_city
)
do
city
.
update!
(
location:
FOREIGN
)
end
city
=
City
.
find_or_create_by!
(
name:
name_city
)
city
.
update
(
location:
FOREIGN
)
end
end
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