fix code crawler

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