Commit a7440cbb by Hoang Phuc

Fix import csv

parent b465fec5
Pipeline #586 failed with stages
in 0 seconds
...@@ -28,14 +28,16 @@ namespace :import do ...@@ -28,14 +28,16 @@ namespace :import do
job_attributes[:company_id] = check_exist_or_create_company(company_attributes) job_attributes[:company_id] = check_exist_or_create_company(company_attributes)
# Create job # Create job
job = check_exist_or_create_job(job_attributes) job = check_exist_or_create_job(job_attributes)
# Industry if job.cities.count == 0 && job.industries.count == 0
industry = check_exist_or_create_industry(row[1]) # Industry
# Industry job industry = check_exist_or_create_industry(row[1])
job.industries << industry # Industry job
# City job.industries << industry
city = check_exist_or_create_city(row[16].gsub('["',"").gsub('"]',"")) # City
# City job city = check_exist_or_create_city(row[16].gsub('["',"").gsub('"]',""))
job.cities << city # City job
job.cities << city
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment