Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
venjob_thanhnd
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
thanhnd
venjob_thanhnd
Commits
4432b5e6
Commit
4432b5e6
authored
Feb 19, 2020
by
thanhnd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix review phase 1 20200219 11:27
parent
d4068924
Pipeline
#469
failed with stages
in 0 seconds
Changes
10
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
38 additions
and
52 deletions
+38
-52
db/migrate/20200204084723_create_cities.rb
+1
-2
db/migrate/20200204084729_create_companies.rb
+0
-2
db/migrate/20200204084737_create_industry_jobs.rb
+2
-2
db/migrate/20200204084741_create_jobs.rb
+4
-4
db/migrate/20200204084746_create_users.rb
+1
-1
db/migrate/20200204084750_create_saved_jobs.rb
+2
-2
db/migrate/20200204084755_create_applied_jobs.rb
+2
-2
db/migrate/20200211083438_remove_column_code_jobtable.rb
+0
-5
db/schema.rb
+22
-24
lib/tasks/crawler.rake
+4
-8
No files found.
db/migrate/20200204084723_create_cities.rb
View file @
4432b5e6
class
CreateCities
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:cities
do
|
t
|
t
.
int
:area_id
t
.
int
eger
:area_id
t
.
string
:city_name
t
.
string
:city_description
t
.
timestamps
end
add_index
:city_name
end
end
db/migrate/20200204084729_create_companies.rb
View file @
4432b5e6
...
...
@@ -10,7 +10,5 @@ class CreateCompanies < ActiveRecord::Migration[6.0]
t
.
string
:size
t
.
timestamps
end
add_index
:companies_name
add_index
:email
end
end
db/migrate/20200204084737_create_industry_jobs.rb
View file @
4432b5e6
class
CreateIndustryJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:industry_jobs
do
|
t
|
t
.
int
:industry_id
t
.
int
:job_id
t
.
int
eger
:industry_id
t
.
int
eger
:job_id
t
.
timestamps
end
end
...
...
db/migrate/20200204084741_create_jobs.rb
View file @
4432b5e6
class
CreateJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:jobs
do
|
t
|
t
.
int
:area_id
t
.
int
:city_id
t
.
int
:industry_id
t
.
int
:company_id
t
.
int
eger
:area_id
t
.
int
eger
:city_id
t
.
int
eger
:industry_id
t
.
int
eger
:company_id
t
.
text
:job_name
t
.
string
:salary
t
.
datetime
:deadline
...
...
db/migrate/20200204084746_create_users.rb
View file @
4432b5e6
...
...
@@ -4,7 +4,7 @@ class CreateUsers < ActiveRecord::Migration[6.0]
t
.
string
:email
t
.
string
:fname
t
.
string
:lname
t
.
int
:role
t
.
int
eger
:role
t
.
string
:remember_digest
t
.
string
:activation_digest
t
.
boolean
:activated
...
...
db/migrate/20200204084750_create_saved_jobs.rb
View file @
4432b5e6
class
CreateSavedJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:saved_jobs
do
|
t
|
t
.
int
:user_id
t
.
int
:job_id
t
.
int
eger
:user_id
t
.
int
eger
:job_id
t
.
timestamps
end
end
...
...
db/migrate/20200204084755_create_applied_jobs.rb
View file @
4432b5e6
class
CreateAppliedJobs
<
ActiveRecord
::
Migration
[
6.0
]
def
change
create_table
:applied_jobs
do
|
t
|
t
.
int
:user_id
t
.
int
:job_id
t
.
int
eger
:user_id
t
.
int
eger
:job_id
t
.
timestamps
end
end
...
...
db/migrate/20200211083438_remove_column_code_jobtable.rb
deleted
100644 → 0
View file @
d4068924
class
RemoveColumnCodeJobtable
<
ActiveRecord
::
Migration
[
6.0
]
def
change
remove_column
:jobs
,
:code
end
end
db/schema.rb
View file @
4432b5e6
...
...
@@ -10,11 +10,11 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_02_
11_083438
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_02_
04_084755
)
do
create_table
"applied_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"job_id"
,
null:
false
t
.
integer
"user_id"
t
.
integer
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
...
...
@@ -32,7 +32,6 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
string
"city_description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"area_id"
],
name:
"index_cities_on_area_id"
end
create_table
"companies"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
...
...
@@ -42,60 +41,59 @@ ActiveRecord::Schema.define(version: 2020_02_11_083438) do
t
.
string
"phone_number"
t
.
string
"website"
t
.
string
"email"
t
.
integer
"size"
t
.
string
"size"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
t
.
index
[
"email"
],
name:
"index_companies_on_email"
end
create_table
"industries"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
text
"industry_name"
,
null:
false
t
.
text
"industry_name"
t
.
string
"industry_description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
create_table
"industry_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"industry_id"
,
null:
false
t
.
integer
"job_id"
,
null:
false
t
.
integer
"industry_id"
t
.
integer
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
create_table
"jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"area_id"
,
null:
false
t
.
integer
"city_id"
,
null:
false
t
.
integer
"industry_id"
,
null:
false
t
.
integer
"company_id"
,
null:
false
t
.
text
"job_name"
,
null:
false
t
.
integer
"area_id"
t
.
integer
"city_id"
t
.
integer
"industry_id"
t
.
integer
"company_id"
t
.
text
"job_name"
t
.
string
"salary"
t
.
date
"deadline"
t
.
date
time
"deadline"
t
.
string
"level"
t
.
string
"experience"
t
.
date
"last_updated"
t
.
date
time
"last_updated"
t
.
text
"description"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
create_table
"saved_jobs"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"job_id"
,
null:
false
t
.
integer
"user_id"
t
.
integer
"job_id"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
end
create_table
"users"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
string
"email"
,
null:
false
t
.
string
"fname"
,
null:
false
t
.
string
"lname"
,
null:
false
t
.
integer
"role"
,
null:
false
t
.
string
"email"
t
.
string
"fname"
t
.
string
"lname"
t
.
integer
"role"
t
.
string
"remember_digest"
t
.
string
"activation_digest"
t
.
boolean
"activated"
t
.
timestamp
"activated_at"
t
.
datetime
"activated_at"
t
.
string
"reset_digest"
t
.
timestamp
"reset_sent_at"
t
.
datetime
"reset_sent_at"
t
.
string
"password_digest"
t
.
datetime
"created_at"
,
precision:
6
,
null:
false
t
.
datetime
"updated_at"
,
precision:
6
,
null:
false
...
...
lib/tasks/crawler.rake
View file @
4432b5e6
...
...
@@ -50,20 +50,16 @@ namespace :crawler do
#insert data to City table:
city_name
=
location
.
text
.
gsub
(
","
,
""
)
City
.
find_or_create_by
(
area_id:
area
.
id
,
city_name:
city_name
,
city_description:
""
)
city
=
City
.
find_or_create_by
(
area_id:
area
.
id
,
city_name:
city_name
,
city_description:
""
)
#insert data to Industry table
Industry
.
find_or_create_by
(
industry_name:
industry
.
text
,
industry_description:
""
)
industry
=
Industry
.
find_or_create_by
(
industry_name:
industry
.
text
,
industry_description:
""
)
#insert data to Companies table
Company
.
find_or_create_by
(
company_name:
company_name
.
text
,
company_description:
company_intro
.
text
,
address:
address
.
text
)
company
=
Company
.
find_or_create_by
(
company_name:
company_name
.
text
,
company_description:
company_intro
.
text
,
address:
address
.
text
)
#insert data to Jobs table
city
=
City
.
find_by
(
area_id:
area
.
id
,
city_name:
city_name
)
industryid
=
Industry
.
find_by
(
industry_name:
industry
.
text
)
companyid
=
Company
.
find_by
(
company_name:
company_name
.
text
)
Job
.
find_or_create_by
(
area_id:
area
.
id
,
city_id:
city
.
id
,
industry_id:
industryid
.
id
,
company_id:
companyid
.
id
,
job_name:
title
.
text
,
salary:
salary
.
text
,
deadline:
deadline
.
text
,
level:
level
.
text
,
experience:
experience
.
text
.
strip
,
last_updated:
updated_date
.
text
.
strip
,
description:
description
.
text
)
Job
.
find_or_create_by
(
area_id:
area
.
id
,
city_id:
city
.
id
,
industry_id:
industry
.
id
,
company_id:
company
.
id
,
job_name:
title
.
text
,
salary:
salary
.
text
,
deadline:
deadline
.
text
,
level:
level
.
text
,
experience:
experience
.
text
.
strip
,
last_updated:
updated_date
.
text
.
strip
,
description:
description
.
text
)
end
list_url
=
nextpage
[
0
][
"href"
]
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