Browse Source

Add and seed 2022 LA links

pull/1488/head
Kat 3 years ago
parent
commit
dbc360fb43
  1. 15
      config/local_authorities_data/local_authority_links_2022.csv
  2. 8
      db/seeds.rb

15
config/local_authorities_data/local_authority_links_2022.csv

@ -0,0 +1,15 @@
local_authority_code,linked_local_authority_code
E06000061,E07000150
E06000061,E07000152
E06000061,E07000153
E06000061,E07000156
E07000150,E06000061
E07000152,E06000061
E07000153,E06000061
E07000156,E06000061
E06000062,E07000151
E06000062,E07000154
E06000062,E07000155
E07000151,E06000062
E07000154,E06000062
E07000155,E06000062
1 local_authority_code linked_local_authority_code
2 E06000061 E07000150
3 E06000061 E07000152
4 E06000061 E07000153
5 E06000061 E07000156
6 E07000150 E06000061
7 E07000152 E06000061
8 E07000153 E06000061
9 E07000156 E06000061
10 E06000062 E07000151
11 E06000062 E07000154
12 E06000062 E07000155
13 E07000151 E06000062
14 E07000154 E06000062
15 E07000155 E06000062

8
db/seeds.rb

@ -316,9 +316,11 @@ unless Rails.env.test?
end end
if (Rails.env.development? || Rails.env.review?) && LocalAuthorityLink.count.zero? if (Rails.env.development? || Rails.env.review?) && LocalAuthorityLink.count.zero?
links_data_path = "config/local_authorities_data/local_authority_links_2023.csv" links_data_paths = ["config/local_authorities_data/local_authority_links_2023.csv","config/local_authorities_data/local_authority_links_2022.csv"]
service = Imports::LocalAuthorityLinksService.new(path: links_data_path) links_data_paths.each do |path|
service.call service = Imports::LocalAuthorityLinksService.new(path:)
service.call
end
pp "Seeded local authority links" pp "Seeded local authority links"
end end

Loading…
Cancel
Save