You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
423 B
14 lines
423 B
2 years ago
|
namespace :data_import do
|
||
|
desc "Import local authorities data"
|
||
|
task :local_authorities, %i[path] => :environment do |_task, args|
|
||
|
path = args[:path]
|
||
|
|
||
|
raise "Usage: rake data_import:local_authorities['path/to/csv_file']" if path.blank?
|
||
|
|
||
|
service = Imports::LocalAuthoritiesService.new(path:)
|
||
|
service.call
|
||
|
|
||
|
pp "Created/updated #{service.count} local authority records" unless Rails.env.test?
|
||
|
end
|
||
|
end
|