From 61a69ef875a2366606503388550a8f26d5c3b56a Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 18 May 2023 16:48:36 +0100 Subject: [PATCH] Confirm location after creating --- app/services/imports/scheme_location_import_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/imports/scheme_location_import_service.rb b/app/services/imports/scheme_location_import_service.rb index 93093e6da..e01cd1106 100644 --- a/app/services/imports/scheme_location_import_service.rb +++ b/app/services/imports/scheme_location_import_service.rb @@ -111,7 +111,8 @@ module Imports if attributes["end_date"] location.location_deactivation_periods.create!(deactivation_date: attributes["end_date"]) end - location + confirm_scheme_or_location(location) + location.save! && location rescue ActiveRecord::RecordNotUnique @logger.warn("Location is already present with legacy ID #{attributes['location_old_id']}, skipping") rescue ActiveRecord::RecordInvalid