Commit 56cba0ab by Ngô Trung Hưng

fix bug

parent 4a5093e8
Pipeline #737 failed with stages
in 0 seconds
......@@ -4,4 +4,5 @@
class City < ApplicationRecord
has_many :city_jobs
has_many :jobs, through: :city_jobs
enum area: { international: 0, domestic:1}
end
......@@ -4,7 +4,6 @@ require 'service/ftp'
# Import data from CSV
class ImportData
DOMESTIC = 1
COMPANY_SECURITY = 1
def import_data
......@@ -39,7 +38,7 @@ class ImportData
cities.each do |val|
next if val.blank?
City.find_or_create_by(name: val) { |city| city.area = DOMESTIC }
City.find_or_create_by(name: val, area: City.areas['domestic'])
end
rescue StandardError => e
logger.error "Import_cities: #{e}"
......
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