diff --git a/app/lib/hub/importer.rb b/app/lib/hub/importer.rb index 25bcbf5..1271a3d 100644 --- a/app/lib/hub/importer.rb +++ b/app/lib/hub/importer.rb @@ -36,11 +36,11 @@ def load read_file(@path) do |data| Hub.create!( - name: data['Teaching School Hub name'], - phone: data['Contact phone number'], - email: data['Email address'], - website: data['TSH website, where available'], - areas: get_local_authorities(data['Teaching School Hub area'].split(' - ').last) + name: data['name'], + phone: data['phone'], + email: data['email'], + website: data['website'], + areas: get_local_authorities(data['areas']) ) end end @@ -55,7 +55,7 @@ def get_local_authorities(string) end inversed_map = @authorities_with_comas_map.invert - mapped.split(', ').map do |str| + mapped.split(';').map do |str| inversed_map[str] || str end end