add

parent e70e49e8
......@@ -6,6 +6,7 @@ class CSVImporter
NAME_DOMAIN = '192.168.1.156'.freeze
FTP_USERNAME = 'training'.freeze
FTP_PASSWORD = 'training'.freeze
def initialize(logger)
@logger = logger
@extracting_directory = Rails.root.join('lib', 'csv')
......@@ -72,7 +73,7 @@ class CSVImporter
industry_job_relationship = IndustryJob.where(job_id: job.id, industry_id: industries_relationship.ids)
next if industry_job_relationship.present?
job.industries << industries_relationship
job.industries << industries_relationship if industry_job_relationship.blank?
location_data = row["work place"]
location = location_data.gsub('["', '').gsub('"]', '')
......@@ -82,7 +83,7 @@ class CSVImporter
location_job_relationship = CityJob.where(job_id: job.id ,city_id: location_relationship.ids)
next if location_job_relationship.present?
job.cities << location_relationship
job.cities << location_relationship if location_job_relationship.blank?
rescue StandardError => e
@logger.error e.message
......
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