fix code crawler

parent 566e2225
Pipeline #912 failed with stages
in 0 seconds
......@@ -13,6 +13,6 @@ class City < ApplicationRecord
private
def set_converted_name
converted_name = convert_attribute(name)
self.converted_name = convert_attribute(name)
end
end
......@@ -6,6 +6,6 @@ class Company < ApplicationRecord
private
def set_converted_name
converted_name = convert_attribute(name)
self.converted_name = convert_attribute(name)
end
end
......@@ -10,6 +10,6 @@ class Industry < ApplicationRecord
private
def set_converted_name
converted_name = convert_attribute(name)
self.converted_name = convert_attribute(name)
end
end
......@@ -32,7 +32,7 @@ class Job < ApplicationRecord
private
def set_converted_name
converted_name = convert_attribute(title)
self.converted_name = convert_attribute(title)
end
end
......@@ -23,13 +23,11 @@ class Crawler
data_city.each do |name_city|
if City.find_by(id: 70)
city = City.find_or_create_by!(name: name_city) do
city.update!(location: VIETNAM)
end
city = City.find_or_create_by!(name: name_city)
city.update(location: VIETNAM)
else
city = City.find_or_create_by!(name: name_city) do
city.update!(location: FOREIGN)
end
city = City.find_or_create_by!(name: name_city)
city.update(location: FOREIGN)
end
end
end
......
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