Commit 3e82e42a by Xuan Trung Le

optimize code

parent de86016d
...@@ -27,7 +27,7 @@ class Job < ApplicationRecord ...@@ -27,7 +27,7 @@ class Job < ApplicationRecord
end end
# Company # Company
company = Company.find_by(name: item[:company_name]) company = Company.find_by(name: item[:company_name])
job.company = job.company =
if company.nil? if company.nil?
Company.create(name: item[:company_name], Company.create(name: item[:company_name],
......
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