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
b44e228c
Commit
b44e228c
authored
Aug 06, 2020
by
Huỳnh Thiên Phước
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create Slug in City and Industry
parent
745be587
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
83 additions
and
36 deletions
+83
-36
app/assets/stylesheets/cities.scss
+1
-0
app/assets/stylesheets/top_pages.scss
+13
-0
app/common/convert.rb
+9
-0
app/controllers/jobs_controller.rb
+9
-10
app/models/city.rb
+1
-0
app/models/company.rb
+5
-0
app/models/industry.rb
+6
-1
app/models/job.rb
+5
-0
app/views/cities/_international.html.erb
+1
-1
app/views/cities/_vietnam.html.erb
+1
-1
app/views/industries/_industry.html.erb
+1
-1
app/views/jobs/_job.html.erb
+3
-5
app/views/jobs/_pagination.html.erb
+1
-1
app/views/jobs/city_jobs.html.erb
+2
-3
app/views/jobs/industry_jobs.html.erb
+2
-3
app/views/layouts/_show_city.html.erb
+1
-1
app/views/layouts/_show_industry.html.erb
+1
-1
app/views/layouts/_show_job.html.erb
+1
-3
config/routes.rb
+2
-2
db/migrate/20200715012914_create_jobs.rb
+2
-0
db/migrate/20200715013619_create_cities.rb
+1
-0
db/migrate/20200715014000_create_industries.rb
+1
-0
db/migrate/20200715014638_create_companies.rb
+2
-1
db/schema.rb
+5
-1
lib/src/crawler.rb
+1
-1
lib/src/csv_importer.rb
+6
-0
No files found.
app/assets/stylesheets/cities.scss
View file @
b44e228c
...
@@ -25,3 +25,4 @@
...
@@ -25,3 +25,4 @@
.viet-nam
,
.international
{
.viet-nam
,
.international
{
cursor
:
pointer
;
cursor
:
pointer
;
}
}
app/assets/stylesheets/top_pages.scss
View file @
b44e228c
...
@@ -110,3 +110,16 @@
...
@@ -110,3 +110,16 @@
}
}
}
}
}
}
.result-for
{
background-color
:
#99ff99
;
border
:
2px
solid
green
;
border-radius
:
12px
;
text-align
:
center
;
}
.total
{
background-color
:
#b3ecff
;
border
:
2px
solid
#006080
;
border-radius
:
12px
;
text-align
:
center
;
font-size
:
32px
;
}
app/common/convert.rb
0 → 100644
View file @
b44e228c
module
Convert
def
self
.
to_convert
(
str
)
str
.
mb_chars
.
normalize
(
:kd
).
gsub
(
/[Đđ]/
,
'd'
).
gsub
(
/[^\x00-\x7F]/
,
''
).
gsub
(
/[\W+]/
,
' '
).
downcase
.
to_s
.
split
(
' '
).
join
(
'-'
)
end
def
self
.
to_convert_name
(
name
)
name
.
mb_chars
.
normalize
(
:kd
).
gsub
(
/[Đđ]/
,
'd'
).
gsub
(
/[^\x00-\x7F]/
,
''
).
gsub
(
/[\W+0-9]/
,
' '
).
downcase
.
to_s
.
split
(
' '
).
join
(
'-'
)
end
end
app/controllers/jobs_controller.rb
View file @
b44e228c
class
JobsController
<
ApplicationController
class
JobsController
<
ApplicationController
before_action
:use_variables
def
index
def
index
@cities
=
City
.
all
@industries
=
Industry
.
all
@total_job
=
Job
.
count
@jobs_list
=
Job
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@jobs_list
=
Job
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
end
end
def
city_jobs
def
city_jobs
@cities
=
City
.
all
@city
=
City
.
find_by
(
converted_name:
params
[
:converted_name
])
@industries
=
Industry
.
all
@city
=
City
.
find_by
(
name:
params
[
:name
])
@jobs_list
=
@city
.
jobs
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@jobs_list
=
@city
.
jobs
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@total_job
=
Job
.
count
@result_for_job
=
@city
.
jobs
.
count
@result_for_job
=
@city
.
jobs
.
count
end
end
def
industry_jobs
def
industry_jobs
@industry
=
Industry
.
find_by
(
converted_name:
params
[
:converted_name
])
@jobs_list
=
@industry
.
jobs
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@result_for_job
=
@industry
.
jobs
.
count
end
def
use_variables
@cities
=
City
.
all
@cities
=
City
.
all
@industries
=
Industry
.
all
@industries
=
Industry
.
all
@industry
=
Industry
.
find
(
params
[
:id
])
@jobs_list
=
@industry
.
jobs
.
all_job
.
page
(
params
[
:page
]).
per
(
20
)
@total_job
=
Job
.
count
@total_job
=
Job
.
count
@result_for_job
=
@industry
.
jobs
.
count
end
end
end
end
app/models/city.rb
View file @
b44e228c
class
City
<
ApplicationRecord
class
City
<
ApplicationRecord
before_save
:convert_city
has_many
:city_jobs
has_many
:city_jobs
has_many
:jobs
,
through: :city_jobs
has_many
:jobs
,
through: :city_jobs
...
...
app/models/company.rb
View file @
b44e228c
class
Company
<
ApplicationRecord
class
Company
<
ApplicationRecord
before_save
:convert_company
has_many
:jobs
has_many
:jobs
def
convert_company
self
.
converted_name
=
Convert
.
to_convert
(
"
#{
name
}
"
)
end
end
end
app/models/industry.rb
View file @
b44e228c
class
Industry
<
ApplicationRecord
class
Industry
<
ApplicationRecord
before_save
:convert_industry
has_many
:industry_jobs
has_many
:industry_jobs
has_many
:jobs
,
through: :industry_jobs
has_many
:jobs
,
through: :industry_jobs
scope
:top_industry
,
->
{
joins
(
:jobs
).
group
(
:industry_id
).
order
(
'count(job_id) DESC'
).
limit
(
9
)
}
scope
:top_industry
,
->
{
joins
(
:jobs
).
group
(
:industry_id
).
order
(
'count(job_id) DESC'
).
limit
(
9
)
}
scope
:all_industry
,
->
{
joins
(
:jobs
).
group
(
:industry_id
).
order
(
'count(job_id) DESC'
)
}
scope
:all_industry
,
->
{
joins
(
:jobs
).
group
(
:industry_id
).
order
(
'count(job_id) DESC'
)
}
def
convert_industry
converted_name
=
Convert
.
to_convert
(
"
#{
name
}
"
)
end
def
convert_name
def
convert_name
name
.
mb_chars
.
normalize
(
:kd
).
gsub
(
/[Đđ]/
,
'd'
).
gsub
(
/[^\x00-\x7F]/
,
''
).
gsub
(
/[\W+0-9]/
,
' '
).
downcase
.
to_s
.
split
(
' '
).
join
(
'-'
)
converted_name
=
Convert
.
to_convert_name
(
"
#{
name
}
"
)
end
end
end
end
app/models/job.rb
View file @
b44e228c
class
Job
<
ApplicationRecord
class
Job
<
ApplicationRecord
before_save
:convert_job
belongs_to
:company
belongs_to
:company
has_many
:city_jobs
has_many
:city_jobs
has_many
:cities
,
through: :city_jobs
has_many
:cities
,
through: :city_jobs
...
@@ -18,6 +19,10 @@ class Job < ApplicationRecord
...
@@ -18,6 +19,10 @@ class Job < ApplicationRecord
scope
:limit_job
,
->
{
includes
(
:cities
,
:company
).
order
(
created_at: :desc
).
limit
(
5
)
}
scope
:limit_job
,
->
{
includes
(
:cities
,
:company
).
order
(
created_at: :desc
).
limit
(
5
)
}
scope
:all_job
,
->
{
limit
(
20
).
order
(
created_at: :desc
)
}
scope
:all_job
,
->
{
limit
(
20
).
order
(
created_at: :desc
)
}
def
convert_job
self
.
converted_name
=
Convert
.
to_convert
(
"
#{
title
}
"
)
end
def
company_name
def
company_name
company
&
.
name
company
&
.
name
end
end
...
...
app/views/cities/_international.html.erb
View file @
b44e228c
<div
class=
"col-3 remove-decoration"
>
<div
class=
"col-3 remove-decoration"
>
<%=
link_to
city_jobs_path
(
name:
city
.
name
)
do
%>
<%=
link_to
city_jobs_path
(
converted_name:
city
.
converted_
name
)
do
%>
<div
class=
"border border-dark rounded vn-name"
>
<div
class=
"border border-dark rounded vn-name"
>
<div>
<div>
<strong>
<%=
city
.
name
%>
</strong>
<strong>
<%=
city
.
name
%>
</strong>
...
...
app/views/cities/_vietnam.html.erb
View file @
b44e228c
<div
class=
"col-3 remove-decoration"
>
<div
class=
"col-3 remove-decoration"
>
<%=
link_to
city_jobs_path
(
name:
city
.
convert_name
)
do
%>
<%=
link_to
city_jobs_path
(
converted_
name:
city
.
convert_name
)
do
%>
<div
class=
"border border-dark rounded international-name"
>
<div
class=
"border border-dark rounded international-name"
>
<div>
<div>
<strong>
<%=
city
.
name
%>
</strong>
<strong>
<%=
city
.
name
%>
</strong>
...
...
app/views/industries/_industry.html.erb
View file @
b44e228c
<div
class=
"col-3 remove-decoration"
>
<div
class=
"col-3 remove-decoration"
>
<%=
link_to
industry_jobs_path
(
industry
.
id
)
do
%>
<%=
link_to
industry_jobs_path
(
converted_name:
industry
.
converted_name
)
do
%>
<div
class=
"border border-dark rounded industry-details"
>
<div
class=
"border border-dark rounded industry-details"
>
<div>
<div>
<strong>
<%=
industry
.
name
%>
</strong>
<strong>
<%=
industry
.
name
%>
</strong>
...
...
app/views/jobs/_job.html.erb
View file @
b44e228c
...
@@ -3,12 +3,10 @@
...
@@ -3,12 +3,10 @@
<div
class=
"job-details"
>
<div
class=
"job-details"
>
<div
class=
"title"
><strong>
<%=
job
.
title
%>
</strong></div>
<div
class=
"title"
><strong>
<%=
job
.
title
%>
</strong></div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-6"
>
▼
<div
class=
"col-5"
>
▼
<%
job
.
cities
.
each
do
|
city
|
%>
<%=
job
.
cities
.
map
(
&
:name
).
join
(
' | '
)
%>
<%=
city
.
name
%>
<%
end
%>
</div>
</div>
<div
class=
"col-
4
salary"
>
💲 Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"col-
5
salary"
>
💲 Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"col-10 introduction"
>
<div
class=
"col-10 introduction"
>
<%=
job_description
(
job
.
description
)
%>
<br>
<%=
job_description
(
job
.
description
)
%>
<br>
<%=
link_to
'Read more..'
,
'#'
%>
<%=
link_to
'Read more..'
,
'#'
%>
...
...
app/views/jobs/_pagination.html.erb
View file @
b44e228c
<div
class=
"row"
>
<div
class=
"row
panigation
"
>
<div
class=
"col-12 d-flex justify-content-end paginate-jobs"
>
<div
class=
"col-12 d-flex justify-content-end paginate-jobs"
>
<%=
paginate
@jobs_list
,
outer_window:
3
,
window:
2
%>
<%=
paginate
@jobs_list
,
outer_window:
3
,
window:
2
%>
</div>
</div>
...
...
app/views/jobs/city_jobs.html.erb
View file @
b44e228c
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
<div
class=
"search-bar"
>
<div
class=
"search-bar"
>
<%=
render
'layouts/search_bar'
%>
<%=
render
'layouts/search_bar'
%>
</div>
</div>
<div
class=
"row total-jobs"
>
<div
class=
"total-jobs"
>
<div
class=
"col-4"
>
Total:
<%=
@total_job
%>
jobs
</div>
<div
class=
"total"
>
Total:
<strong>
<%=
@result_for_job
%>
</strong>
jobs in
<strong>
<%=
@city
.
name
%>
</strong></div>
<div
class=
"col-4"
>
Result for:
<%=
@result_for_job
%>
jobs
</div>
</div>
</div>
<%=
render
"jobs/pagination"
%>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<div
class=
"job-list"
>
...
...
app/views/jobs/industry_jobs.html.erb
View file @
b44e228c
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
<div
class=
"search-bar"
>
<div
class=
"search-bar"
>
<%=
render
'layouts/search_bar'
%>
<%=
render
'layouts/search_bar'
%>
</div>
</div>
<div
class=
"row total-jobs"
>
<div
class=
"total-jobs"
>
<div
class=
"col-4"
>
Total:
<%=
@total_job
%>
jobs
</div>
<div
class=
"total"
>
Total:
<strong>
<%=
@result_for_job
%>
</strong>
jobs in
<strong>
<%=
@industry
.
name
%>
</strong></div>
<div
class=
"col-4"
>
Result for:
<%=
@result_for_job
%>
jobs
</div>
</div>
</div>
<%=
render
"jobs/pagination"
%>
<%=
render
"jobs/pagination"
%>
<div
class=
"job-list"
>
<div
class=
"job-list"
>
...
...
app/views/layouts/_show_city.html.erb
View file @
b44e228c
<div
class=
"col-4"
>
<div
class=
"col-4"
>
<div
class=
"row-table border border-dark rounded city-list"
>
<div
class=
"row-table border border-dark rounded city-list"
>
<%=
link_to
city_jobs_path
(
name:
city
.
name
)
do
%>
<%=
link_to
city_jobs_path
(
converted_name:
city
.
converted_
name
)
do
%>
<div
class=
"city-name"
><strong>
<%=
city
.
name
%>
</strong></div>
<div
class=
"city-name"
><strong>
<%=
city
.
name
%>
</strong></div>
<div
class=
"count-job"
>
<%=
city
.
jobs
.
count
%>
</div>
<div
class=
"count-job"
>
<%=
city
.
jobs
.
count
%>
</div>
<%
end
%>
<%
end
%>
...
...
app/views/layouts/_show_industry.html.erb
View file @
b44e228c
<div
class=
"col-4"
>
<div
class=
"col-4"
>
<div
class=
"row-table border border-dark rounded industry-list"
>
<div
class=
"row-table border border-dark rounded industry-list"
>
<%=
link_to
industry_jobs_path
(
industry
.
id
)
do
%>
<%=
link_to
industry_jobs_path
(
converted_name:
industry
.
converted_name
)
do
%>
<div
class=
"industry-name"
><strong>
<%=
industry
.
name
%>
</strong></div>
<div
class=
"industry-name"
><strong>
<%=
industry
.
name
%>
</strong></div>
<div
class=
"count-job"
>
<%=
industry
.
jobs
.
count
%>
</div>
<div
class=
"count-job"
>
<%=
industry
.
jobs
.
count
%>
</div>
<%
end
%>
<%
end
%>
...
...
app/views/layouts/_show_job.html.erb
View file @
b44e228c
...
@@ -5,9 +5,7 @@
...
@@ -5,9 +5,7 @@
<div>
<%=
job
.
company_name
%>
</div>
<div>
<%=
job
.
company_name
%>
</div>
<div
class=
"salary"
>
💲 Salary:
<%=
job
.
salary
%>
</div>
<div
class=
"salary"
>
💲 Salary:
<%=
job
.
salary
%>
</div>
<div>
▼
<div>
▼
<%
job
.
cities
.
each
do
|
city
|
%>
<%=
job
.
cities
.
map
(
&
:name
).
join
(
' | '
)
%>
<%=
city
.
name
%>
<%
end
%>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-10 introduction"
>
<div
class=
"col-10 introduction"
>
...
...
config/routes.rb
View file @
b44e228c
Rails
.
application
.
routes
.
draw
do
Rails
.
application
.
routes
.
draw
do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources
:jobs
resources
:jobs
get
'jobs/city/:name'
,
to:
'jobs#city_jobs'
,
as: :city_jobs
get
'jobs/city/:
converted_
name'
,
to:
'jobs#city_jobs'
,
as: :city_jobs
get
'jobs/industry/:
id
'
,
to:
'jobs#industry_jobs'
,
as: :industry_jobs
get
'jobs/industry/:
converted_name
'
,
to:
'jobs#industry_jobs'
,
as: :industry_jobs
resources
:top_pages
resources
:top_pages
resources
:industries
resources
:industries
...
...
db/migrate/20200715012914_create_jobs.rb
View file @
b44e228c
...
@@ -8,6 +8,8 @@ class CreateJobs < ActiveRecord::Migration[5.2]
...
@@ -8,6 +8,8 @@ class CreateJobs < ActiveRecord::Migration[5.2]
t
.
string
:experience
t
.
string
:experience
t
.
string
:expiration_date
t
.
string
:expiration_date
t
.
bigint
:company_id
t
.
bigint
:company_id
t
.
string
:converted_name
t
.
timestamps
t
.
timestamps
end
end
end
end
...
...
db/migrate/20200715013619_create_cities.rb
View file @
b44e228c
...
@@ -3,6 +3,7 @@ class CreateCities < ActiveRecord::Migration[5.2]
...
@@ -3,6 +3,7 @@ class CreateCities < ActiveRecord::Migration[5.2]
create_table
:cities
,
:options
=>
'COLLATE=utf8_general_ci'
do
|
t
|
create_table
:cities
,
:options
=>
'COLLATE=utf8_general_ci'
do
|
t
|
t
.
string
:name
t
.
string
:name
t
.
boolean
:location
t
.
boolean
:location
t
.
string
:converted_name
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20200715014000_create_industries.rb
View file @
b44e228c
...
@@ -2,6 +2,7 @@ class CreateIndustries < ActiveRecord::Migration[5.2]
...
@@ -2,6 +2,7 @@ class CreateIndustries < ActiveRecord::Migration[5.2]
def
change
def
change
create_table
:industries
,
:options
=>
'COLLATE=utf8_general_ci'
do
|
t
|
create_table
:industries
,
:options
=>
'COLLATE=utf8_general_ci'
do
|
t
|
t
.
string
:name
t
.
string
:name
t
.
string
:converted_name
t
.
timestamps
t
.
timestamps
end
end
...
...
db/migrate/20200715014638_create_companies.rb
View file @
b44e228c
...
@@ -4,7 +4,8 @@ class CreateCompanies < ActiveRecord::Migration[5.2]
...
@@ -4,7 +4,8 @@ class CreateCompanies < ActiveRecord::Migration[5.2]
t
.
string
:name
t
.
string
:name
t
.
text
:address
t
.
text
:address
t
.
text
:introduction
t
.
text
:introduction
t
.
string
:converted_name
t
.
timestamps
t
.
timestamps
end
end
end
end
...
...
db/schema.rb
View file @
b44e228c
...
@@ -10,11 +10,12 @@
...
@@ -10,11 +10,12 @@
#
#
# It's strongly recommended that you check this file into your version control system.
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_07_
23_071239
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_07_
15_035356
)
do
create_table
"cities"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
create_table
"cities"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
string
"name"
t
.
string
"name"
t
.
boolean
"location"
t
.
boolean
"location"
t
.
string
"converted_name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
...
@@ -30,6 +31,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
...
@@ -30,6 +31,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
t
.
string
"name"
t
.
string
"name"
t
.
text
"address"
t
.
text
"address"
t
.
text
"introduction"
t
.
text
"introduction"
t
.
string
"converted_name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
...
@@ -50,6 +52,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
...
@@ -50,6 +52,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
create_table
"industries"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
create_table
"industries"
,
options:
"ENGINE=InnoDB DEFAULT CHARSET=utf8"
,
force: :cascade
do
|
t
|
t
.
string
"name"
t
.
string
"name"
t
.
string
"converted_name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
...
@@ -79,6 +82,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
...
@@ -79,6 +82,7 @@ ActiveRecord::Schema.define(version: 2020_07_23_071239) do
t
.
string
"experience"
t
.
string
"experience"
t
.
string
"expiration_date"
t
.
string
"expiration_date"
t
.
bigint
"company_id"
t
.
bigint
"company_id"
t
.
string
"converted_name"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
end
...
...
lib/src/crawler.rb
View file @
b44e228c
...
@@ -3,6 +3,7 @@ class Crawler
...
@@ -3,6 +3,7 @@ class Crawler
VIETNAM
=
0
VIETNAM
=
0
FOREIGN
=
1
FOREIGN
=
1
def
initialize
(
logger
,
url
)
def
initialize
(
logger
,
url
)
@logger
=
logger
@logger
=
logger
@url
=
url
@url
=
url
...
@@ -74,7 +75,6 @@ class Crawler
...
@@ -74,7 +75,6 @@ class Crawler
expiration_date:
expiration_date
,
expiration_date:
expiration_date
,
description:
description
,
description:
description
,
company_id:
company
.
id
)
company_id:
company
.
id
)
city_relationship
(
row
,
job
)
city_relationship
(
row
,
job
)
industry_relationship
(
row
,
job
)
industry_relationship
(
row
,
job
)
end
end
...
...
lib/src/csv_importer.rb
View file @
b44e228c
...
@@ -59,6 +59,12 @@ class CSVImporter
...
@@ -59,6 +59,12 @@ class CSVImporter
salary:
salary
,
salary:
salary
,
company_id:
company_id
)
company_id:
company_id
)
job
=
Job
.
find_or_create_by!
(
title:
title_job
,
description:
description_job
,
level:
level
,
salary:
salary
,
company_id:
company
.
id
)
industry_name
=
row
[
"category"
]
industry_name
=
row
[
"category"
]
industries_relationship
=
Industry
.
where
(
name:
industry_name
)
industries_relationship
=
Industry
.
where
(
name:
industry_name
)
next
if
industries_relationship
.
blank?
next
if
industries_relationship
.
blank?
...
...
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