Commit 5c50f4b3 by Xuan Trung Le

optimize code

parent 3e82e42a
......@@ -28,15 +28,14 @@ class Job < ApplicationRecord
# Company
company = Company.find_by(name: item[:company_name])
job.company =
if company.nil?
Company.create(name: item[:company_name],
company = Company.create(name: item[:company_name],
location: item[:company_location],
description: item[:company_description])
else
company
end
job.company.cities = job.cities
job.company = company
job.company.cities << (job.cities - job.company.cities)
# Industry
unless item[:industry].blank?
......
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