Commit 56cba0ab by Ngô Trung Hưng

fix bug

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