From dca67c59cac1574313d46c0c02dbde9cce9dcf81 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Mon, 2 Feb 2026 15:48:49 +0100 Subject: [PATCH] Bust the cache after import Without this exporting, deleting and then re-imporing an account would reuse the old cache entries since the IDs are the same, but those cache entries will likely have the old account ID and would break --- app/models/account/data_transfer/record_set.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/account/data_transfer/record_set.rb b/app/models/account/data_transfer/record_set.rb index ed3039210..af112d03e 100644 --- a/app/models/account/data_transfer/record_set.rb +++ b/app/models/account/data_transfer/record_set.rb @@ -71,7 +71,9 @@ class Account::DataTransfer::RecordSet def import_batch(files) batch_data = files.map do |file| data = load(file) - data.slice(*attributes).merge("account_id" => account.id) + data.slice(*attributes).merge("account_id" => account.id).tap do |record_data| + record_data["updated_at"] = Time.current if record_data.key?("updated_at") + end end model.insert_all!(batch_data)