Skip to content

Commit

Permalink
Adjust Hub::Importer for the new format
Browse files Browse the repository at this point in the history
  • Loading branch information
slawosz committed Sep 28, 2023
1 parent 90989ef commit 2c84b85
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/lib/hub/importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2c84b85

Please sign in to comment.