|
|
|
@ -1,7 +1,6 @@ |
|
|
|
namespace :data_import do |
|
|
|
namespace :data_import do |
|
|
|
desc "Add CsvVariableDefinition records for each file in the specified directory" |
|
|
|
desc "Add CsvVariableDefinition records for each file in the specified directory" |
|
|
|
task :add_variable_definitions, [:path] => :environment do |_task, args| |
|
|
|
task :add_variable_definitions, [:path] => :environment do |_task, args| |
|
|
|
CsvVariableDefinition.delete_all |
|
|
|
|
|
|
|
path = Rails.root.join(args[:path]) |
|
|
|
path = Rails.root.join(args[:path]) |
|
|
|
service = Imports::VariableDefinitionsService.new(path:) |
|
|
|
service = Imports::VariableDefinitionsService.new(path:) |
|
|
|
service.call |
|
|
|
service.call |
|
|
|
|