Browse Source

feat: add tests for relationship import

full-import-optimisation
natdeanlewissoftwire 1 year ago
parent
commit
57e8e67d78
  1. 2
      app/services/imports/organisation_relationship_import_service.rb
  2. 12
      lib/tasks/full_import.rake

2
app/services/imports/organisation_relationship_import_service.rb

@ -4,7 +4,7 @@ module Imports
import_from(folder, :create_organisation_relationships)
end
private
private
def create_organisation_relationship(xml_document)
parent_organisation_id = find_organisation_id(xml_document, "parent-institution")

12
lib/tasks/full_import.rake

@ -111,15 +111,3 @@ namespace :import do
desc "Run a full import for the institutions listed in the named file on s3"
task :full, %i[institutions_csv_name] => %i[environment initial logs trigger_invites generate_reports]
end
require 'benchmark'
class Rake::Task
def execute_with_benchmark(*args)
bm = Benchmark.measure { execute_without_benchmark(*args) }
puts " #{name} --> #{bm}"
end
alias_method :execute_without_benchmark, :execute
alias_method :execute, :execute_with_benchmark
end

Loading…
Cancel
Save